nolf1-modernizer icon indicating copy to clipboard operation
nolf1-modernizer copied to clipboard

Possibly DeathScene AI bug

Open haekb opened this issue 4 years ago • 0 comments

AI Programmer for NOLF dropped this tidbit of knowledge. Not sure if that was ever patched though.

I can tell you one bug we did ship though.
We ... uhh "I"
I forget the exact details, but basically there was a point, after an AI dies and turns into a Body, and there's a DeathScene ... somewhere in there, I had gotten a pointer, and cast it to the wrong thing.
So when I call the wrong method on the object, it dispatched to some other method's impl.
And that other method reads at offset X from within the object
It just so happened that at offset X was the actual value I was TRYING to get
Shipped that to PC, but it "worked"
While we were porting to PS2, the first time someone killed an enemy, the game crashed
They called me over and I worked through things and realize the bug in sheer terror
Turns out that the PS2 compiler was putting the vtable ptr at the bottom of the object instead of the top, so offset X was no longer in a "two wrongs make a right situation"
The bug definitely went onto the gold master and shipped
I definitely checked in a fix, but don't know if that fix ever went anywhere physically
Yeah, wish I could remember exactly what the bug was, would be hard to verify the presence of a fix from memory
"if it works, it works" :stuck_out_tongue:

haekb avatar Mar 20 '20 04:03 haekb