[patch] Game crashes while withdrawing convoy December 31, 2009, 03:27:48 pm This patch fixes two errors, which accessed a convoi_t object after its self destruction. Ivansanchez posted this error in the Simutrans Experimental topic http://forum.simutrans.com/index.php?topic=4126.0 Quote Selected
Re: [patch] Game crashes while withdrawing convoy Reply #1 – December 31, 2009, 03:54:48 pm is there a specific procedure to trigger a crash?Does the attached patch also fix the issue? (I did not like the implicit state-change in laden()) Quote Selected
Re: [patch] Game crashes while withdrawing convoy Reply #2 – December 31, 2009, 04:11:54 pm Yes, but the savegame is an experimental 7.1 savegame using pak128.Britain.Exp: Withdraw all 800 convoys from line "Newcastle-Cambridge cattle convoy".No, your patch still continues to use deleted object data in step() after returning from laden(). step() must return before the line switch(state) accesses state. Therefore laden() should not destroy the object, but return a flag, that the object has to be destroyed, which is done best by setting state to SELF_DESTRUCT.Hm, I should learn to read... Your patch will delete the convoy in the next step. You should check the impact of this changed behaviour. Quote Selected Last Edit: December 31, 2009, 04:29:23 pm by Bernd Gabriel
Re: [patch] Game crashes while withdrawing convoy Reply #3 – December 31, 2009, 04:26:55 pm I see. Thank you very mch. Will be included next year:)) Quote Selected
Re: [patch] Game crashes while withdrawing convoy Reply #4 – December 31, 2009, 09:43:33 pm The world needs to step convois backwards then. So I added there a fix too. Quote Selected