Game crashes after loading saved games #96
Comments
Kreuvf commented What is 'a saved game'? A save-game created with the same version? |
EvilGuru commented It could be an endian issue. Needs further investigation (Ideally done by someone with a PPC Mac). |
bearda commented Yes, saving with the same version results in bad bumpDir values. Almost all my saved games that weren't generated between levels (when the stat page pops up) have the same problem, it isn't one or two specific saves. I tried saving my game, going to the main menu, then immediately loading the save I had just created and had my debug print spewing bad bumpDir values before resetting them to 0. When I have a minute I'll try converting some of the bad values I get back to little-endian and see if they fall into the 0-360 range. I have two PPC Macs (one mini and one iBook, both G4s) available if anyone wants me to test something. The mini is the only one set up to actually build the code at the moment, though, so it's where I've done all my testing so far. |
Giel changed blocking which not transferred by tractive |
anonymous changed blockedby which not transferred by tractive |
anonymous commented I've come to realize my problem in #177 is definitely exactly the same as described here. My bad for double-posting a bug. Not sure if there is a way to merge these or something... |
Giel commented Replying to Warzone2100/old-trac-import#96 (comment:5):
I closed #177 marking it as a duplicate. As for merging there's no need really, as we can always follow the links... |
mathew.eis@... commented It appears that, at least on the PPC platform, bumpDir is being swapped twice. What takes place is roughly as follows: // Saved droid is loaded...
// bumpDir is swapped...
// Call function to create actual droid from saved droid
// Call function to copy move data into actual droid from saved droid
// bumpDir is swapped again!?
Possibly this is a bug in the way that LoadDroidMoveControl is set up... A rough examination makes it appear that all the byte swapping code should be removed from LoadDroidMoveControl, since it already was done in move.c:6481-6497 - not sure how this would affect x86 platforms though. |
mathew.eis@... commented The above referenced file should be game.c, not move.c |
Giel changed resolution from `` to |
Giel changed status from |
Giel commented (In [6513]) Merged revision [6512] into the 2.1 branch via svnmerge from trunk ........
|
keyword_crash
keyword_mac
keyword_save
resolution_fixed
type_bug
| by beardaUsing the latest trunk code on a Mac OS X machine (10.5.3, G4 mac mini).
Loading a saved game results in a crash most of the time with the following error on console:
error : [dirDiff] dirDiff: result out of range
error : [dirDiff] Assert in Warzone: /Users/freddie/Documents/Programming/Warzone2.1/macosx/../src/move.c:252 (retval >=0 && retval <=180), last script event: 'N/A'
Assertion failed: (retval >=0 && retval <=180), function dirDiff, file /Users/freddie/Documents/Programming/Warzone2.1/macosx/../src/move.c, line 252.
Abort trap
Further investigation suggests that the bumpDir element of many saved droids has an invalid value (not 0-360), causing the assertion in move.c to fail. Inserting checks when bumpDir is read from the filesystem to make sure it falls in a valid range and resetting it to 0 if it doesn't seems to avoid the assert fail but doesn't explain why the bad values are being read in the first place.
Issue migrated from trac:96 at 2022-04-15 17:44:07 -0700
The text was updated successfully, but these errors were encountered: