[Ohrrpgce] SVN: teeemcee/9197 Fix corruption bug where enemy weak/strong/absorb/enemytype bits got wip

subversion at HamsterRepublic.com subversion at HamsterRepublic.com
Tue Aug 29 08:30:52 PDT 2017


teeemcee
2017-08-29 08:30:52 -0700 (Tue, 29 Aug 2017)
1074
Fix corruption bug where enemy weak/strong/absorb/enemytype bits got wiped instead of upgraded!

This only happened when upgrading a game last edited in 2007 or earlier, because
in that case the enemy data got loaded and saved into an EnemyDef twice, and
load/saveenemydata are lossy, they depended on upgrade() doing the necessary
upgrades.

SoJ is an example of a game corrupted by this bug (cause of the 'TrueSight kills
everything in one hit' bug reported already many years ago). I left in the
routine I used to repair it by copying enemy data from an old .dt1 lump.

Also, if genNumElements is invalid, set it to 64 instead of 1, because
all elements above it get wiped!

load/saveenemydata (for EnemyDef) are still lossy, but dataloss is now avoided
by only calling them once so upgrades to a lump are performed at the same time.
This also avoids completely different codepaths when upgrading games of
different ages. I've been cleaning up upgrade() in this direction.
It's also safer if load/save routines check the relevant fixbits rather than
relying on upgrade().
---
U   wip/common.rbas
U   wip/loading.rbas
U   wip/whatsnew.txt


More information about the Ohrrpgce mailing list