@Blackcat: Ok, noted.
Fixed. It will be in next update.
The first fix I did correctly set the values causing the crash however in the process it reset some others. That's why it scrambles from top center of map ~(0,0) but doesn't crash. I've refined method by setting only the values I need myself rather than using an existing function causing reset. The values causing the crash are x,y coord of scrambling unit. In vanilla game, certain globals that should have been these x,y coord were never set defaulting to value of -3. So when another section of the code retrieved these globals and tried to use them to locate tile data from MapData (see txt by Andux) since they're negative it would try to locate values above MapData memory. So depending on how the map data was loaded into memory determined if the game was going to crash or not. If there was "dead" buffer space above MapData, it would just obtain incorrect values to use in checks (byte 1 in MapData Struct). However, if there was nothing above MapData it would try to access invalid memory and crash.
Figuring this out will be useful to track down issues like that incorrect artillery bonus since I have a better idea about how tiles are set.
From BlackCat's saved game:
Originally posted by Psyringe
View Post
The first fix I did correctly set the values causing the crash however in the process it reset some others. That's why it scrambles from top center of map ~(0,0) but doesn't crash. I've refined method by setting only the values I need myself rather than using an existing function causing reset. The values causing the crash are x,y coord of scrambling unit. In vanilla game, certain globals that should have been these x,y coord were never set defaulting to value of -3. So when another section of the code retrieved these globals and tried to use them to locate tile data from MapData (see txt by Andux) since they're negative it would try to locate values above MapData memory. So depending on how the map data was loaded into memory determined if the game was going to crash or not. If there was "dead" buffer space above MapData, it would just obtain incorrect values to use in checks (byte 1 in MapData Struct). However, if there was nothing above MapData it would try to access invalid memory and crash.
Figuring this out will be useful to track down issues like that incorrect artillery bonus since I have a better idea about how tiles are set.
From BlackCat's saved game:
Comment