Browse Source

Fixed player base block is zero bug after loading a new game. This value is not saved in single player or multiplayer, so when a character is loaded, the value is always zero. Now when a player is loaded, it is set to the default. See section 2.1.4 in Jarulf's Guide.

pull/828/head
Troy Bronzan 6 years ago committed by Anders Jenbo
parent
commit
8960450560
  1. 3
      Source/loadsave.cpp
  2. 1
      Source/pack.cpp

3
Source/loadsave.cpp

@ -357,6 +357,9 @@ void LoadPlayer(int i)
CopyInt(tbuff, &pPlayer->_pStatPts);
CopyInt(tbuff, &pPlayer->_pDamageMod);
CopyInt(tbuff, &pPlayer->_pBaseToBlk);
if (pPlayer->_pBaseToBlk == 0) {
pPlayer->_pBaseToBlk = ToBlkTbl[pPlayer->_pClass];
}
CopyInt(tbuff, &pPlayer->_pHPBase);
CopyInt(tbuff, &pPlayer->_pMaxHPBase);
CopyInt(tbuff, &pPlayer->_pHitPoints);

1
Source/pack.cpp

@ -200,6 +200,7 @@ void UnPackPlayer(PkPlayerStruct *pPack, int pnum, BOOL killok)
pPlayer->_pGold = SwapLE32(pPack->pGold);
pPlayer->_pMaxHPBase = SwapLE32(pPack->pMaxHPBase);
pPlayer->_pHPBase = SwapLE32(pPack->pHPBase);
pPlayer->_pBaseToBlk = ToBlkTbl[pPlayer->_pClass];
if (!killok)
if ((int)(pPlayer->_pHPBase & 0xFFFFFFC0) < 64)
pPlayer->_pHPBase = 64;

Loading…
Cancel
Save