Closed donnierussellii closed 5 years ago
Added general-use CalcMotionCurOffset() that functions call.
Ran into a crash testing this. Steps to reproduce:
12:30:23 WARN resfile.c:217: ResCloseFile: filenum 7 not in use
Segmentation fault: 11
I pick up the pipe and try to put it in the first slot, which should put slot one weapon on cursor. I think something wrong is going on in push_cursor_object().
This crash happens in the 0.6 release version as well, so I think it's unrelated to this PR.
I'll try to fix the crash with commits to this PR.
The ctrl+2 cheat command adds weapons to an array, but does not actually create real obj's that can be dropped. When the game tries to put one of these "fake" objects on the cursor, it has nothing to work with.
Adding a null bmp check in push_cursor_object() to prevent the crash...
With a new game and the weapon slots all empty, when I ctrl+2 I can't drop any of the weapons.
But, starting with a new game, if I pick up the pipe, then ctrl+2, then right click the first weapon slot, the slot weapon disappears but nothing appears on the cursor.
The cheat commands in general are very hacky. For example, weapons are added without filling in all of the struct members, which can cause a crash if the ammo type is out of range.
Also fix cursor-related crashes when changing screen resolution combined with entering/exiting cyberspace.