Patch for crash on linux 64-bit

https://attnam.com/topics/Patch-for-crash-on-linux-64-bit

The Cathedral of Attnam > Other Coding

#1 May 11, 2012, 8:42 am Hide

dlbeswick

Hi everyone, I started playing IVAN again recently and decided to try the CVS download on this site with the 64-bit fixes. Everything compiled great, but the game crashed when going up and down dungeons. I've attached a small patch that fixes the issue. I haven't tested too much yet, I'll let you know if there's more problems with it.

I don't know if the problem is only on linux or only on 64-bit, but that's the platform I had problems on.

Thanks for keeping this site going!
#2 May 11, 2012, 8:46 am Hide

dlbeswick

I didn't attach properly, sorry
#3 May 11, 2012, 10:30 am Hide

fejoa

Hi dlbeswick and welcome! It's a great day when someone works on IVAN.
Can you explain how you fixed the bug?
#4 May 11, 2012, 10:48 am Hide

dlbeswick

Sure. The character's save method was saving out the result of GetTeam as a ulong type, but the load method was assuming the team was saved as an "int" type when that data was being restored, which gives the wrong result. That bad number got passed to game::GetTeam, which meant that the character's Team object was set to an invalid memory location. The patch makes sure the data gets loaded as a ulong.
#5 May 14, 2012, 4:37 pm Hide

fejoa

Thanks D. This is one of those crazy bugs that tempts you to code more IVAN.