[Ohrrpgce] SVN: teeemcee/8741 upgrade: ensure record counts are correct before doing anything else

subversion at HamsterRepublic.com subversion at HamsterRepublic.com
Sun May 7 10:07:38 PDT 2017


teeemcee
2017-05-07 10:07:38 -0700 (Sun, 07 May 2017)
758
upgrade: ensure record counts are correct before doing anything else

There was a lot of code in upgrade that used constants like genMaxTextbox
before they had been verified. This could possibly have resulted in a lot of
blank records getting appended when upgrading, although I didn't see it happen.

This is a pretty significant change to the way upgrade() works, and means that
now any code that initialises a new lump has to set the record count for it too,
so I spent a lot of time checking all that.

Also added fix_record_count lines for genMaxSong and genMaxHero,
and make fix_record_count set the count to zero if the file is missing.

This also fixes up to 2000 error messages from LoadTextBox/SaveTextBox about
invalid record numbers in old games!
---
U   wip/common.rbas


More information about the Ohrrpgce mailing list