sadger / CorsixTH

Open source clone of Theme Hospital
Other
1 stars 0 forks source link

Backwards compatibility is broken for epidemics #33

Open sadger opened 9 years ago

sadger commented 9 years ago

I have had a few random crashes with missing variables for old saves. It should be an easy fix just putting this here so I can document any findings and so I can tick it off when it's done.

sadger commented 9 years ago

@MarkL1961 I think it's due if you have a save file version 81 the onLoad function in hospital.lua only checks for version less than 81 so it's not executed. Do you think we should move the save version on a count and check for <82 I think this should solve my problem.

MarkL1961 commented 9 years ago

You need to see what the current save number is in app.lua, then increase that by one and use that for any afterloads you have. So if at 85 now then change to 86 and then in your afterloads it is if <86 then do this. Most files have an after load function and you add to those

sadger commented 9 years ago

Ok I will do that and I think that should fix most of the backward compatibility issues.

MarkL1961 commented 9 years ago

It'll be where ever you have added new values that the game would normally take from the start and does not otherwise pick up during game play. If you want any help I can take a look at weekend and see if you have missed anything

sadger commented 9 years ago

I'll have another check and make sure about the variables and test some old saves out. I think it's just a matter of making sure that every save up to 81 loads the new onLoad stuff

sadger commented 9 years ago

Incremented the save version in 9bc8e61 in order to fix backward compatibility. Seems to have worked but needs testing.