Browse Source

Clean up load/save code

Remove most call to memcpy in preperation for Big Endian support
Document what pointers are being skipped
Align save and load code (easier to verify that both are correct)
pull/261/head
Anders Jenbo 7 years ago
parent
commit
049178cb2e
  1. 446
      Source/loadsave.cpp
  2. 4
      Source/loadsave.h
  3. 32
      SourceX/DiabloUI/diabloui.cpp
  4. 6
      structs.h

446
Source/loadsave.cpp

@ -207,46 +207,40 @@ BOOL OLoad()
return FALSE; return FALSE;
} }
void CopyInt(const void *src, void *dst) void CopyBytes(const void *src, const int n, void *dst)
{ {
memcpy(dst, src, 4); memcpy(dst, src, n);
tbuff += 4; tbuff += n;
} }
void CopyShort(const void *src, void *dst) void CopyChar(const void *src, void *dst)
{ {
memcpy(dst, src, 2); CopyBytes(src, 1, dst);
tbuff += 2;
} }
void CopyShorts(const void *src, const int n, void *dst) void CopyShort(const void *src, void *dst)
{ {
memcpy(dst, src, 2 * n); CopyBytes(src, 2, dst);
tbuff += 2 * n;
} }
void CopyInts(const void *src, const int n, void *dst) void CopyShorts(const void *src, const int n, void *dst)
{ {
memcpy(dst, src, 4 * n); CopyBytes(src, 2 * n, dst);
tbuff += 4 * n;
} }
void CopyBytes(const void *src, const int n, void *dst) void CopyInt(const void *src, void *dst)
{ {
memcpy(dst, src, n); CopyBytes(src, 4, dst);
tbuff += n;
} }
void CopyChar(const void *src, void *dst) void CopyInts(const void *src, const int n, void *dst)
{ {
memcpy(dst, src, 1); CopyBytes(src, 4 * n, dst);
tbuff += 1;
} }
void CopyInt64(const void *src, void *dst) void CopyInt64(const void *src, void *dst)
{ {
memcpy(dst, src, 8); CopyBytes(src, 8, dst);
tbuff += 8;
} }
void LoadPlayer(int i) void LoadPlayer(int i)
@ -254,11 +248,9 @@ void LoadPlayer(int i)
PlayerStruct *pPlayer = &plr[i]; PlayerStruct *pPlayer = &plr[i];
CopyInt(tbuff, &pPlayer->_pmode); CopyInt(tbuff, &pPlayer->_pmode);
CopyBytes(tbuff, 25, pPlayer->walkpath); CopyBytes(tbuff, 25, pPlayer->walkpath);
CopyBytes(tbuff, 1, &pPlayer->plractive); CopyBytes(tbuff, 1, &pPlayer->plractive);
tbuff += 2; tbuff += 2; // Alignment
CopyInt(tbuff, &pPlayer->destAction); CopyInt(tbuff, &pPlayer->destAction);
CopyInt(tbuff, &pPlayer->destParam1); CopyInt(tbuff, &pPlayer->destParam1);
CopyInt(tbuff, &pPlayer->destParam2); CopyInt(tbuff, &pPlayer->destParam2);
@ -282,7 +274,7 @@ void LoadPlayer(int i)
CopyInt(tbuff, &pPlayer->_pdir); CopyInt(tbuff, &pPlayer->_pdir);
CopyInt(tbuff, &pPlayer->_nextdir); CopyInt(tbuff, &pPlayer->_nextdir);
CopyInt(tbuff, &pPlayer->_pgfxnum); CopyInt(tbuff, &pPlayer->_pgfxnum);
tbuff += 4; // Skip pointers tbuff += 4; // Skip pointer _pAnimData
CopyInt(tbuff, &pPlayer->_pAnimDelay); CopyInt(tbuff, &pPlayer->_pAnimDelay);
CopyInt(tbuff, &pPlayer->_pAnimCnt); CopyInt(tbuff, &pPlayer->_pAnimCnt);
CopyInt(tbuff, &pPlayer->_pAnimLen); CopyInt(tbuff, &pPlayer->_pAnimLen);
@ -296,33 +288,34 @@ void LoadPlayer(int i)
CopyInt(tbuff, &pPlayer->_pSpell); CopyInt(tbuff, &pPlayer->_pSpell);
CopyChar(tbuff, &pPlayer->_pSplType); CopyChar(tbuff, &pPlayer->_pSplType);
CopyChar(tbuff, &pPlayer->_pSplFrom); CopyChar(tbuff, &pPlayer->_pSplFrom);
tbuff += 2; tbuff += 2; // Alignment
CopyInt(tbuff, &pPlayer->_pTSpell); CopyInt(tbuff, &pPlayer->_pTSpell);
CopyChar(tbuff, &pPlayer->_pTSplType); CopyChar(tbuff, &pPlayer->_pTSplType);
tbuff += 3; tbuff += 3; // Alignment
CopyInt(tbuff, &pPlayer->_pRSpell); CopyInt(tbuff, &pPlayer->_pRSpell);
CopyChar(tbuff, &pPlayer->_pRSplType); CopyChar(tbuff, &pPlayer->_pRSplType);
tbuff += 3; tbuff += 3; // Alignment
CopyInt(tbuff, &pPlayer->_pSBkSpell); CopyInt(tbuff, &pPlayer->_pSBkSpell);
CopyChar(tbuff, &pPlayer->_pSBkSplType); CopyChar(tbuff, &pPlayer->_pSBkSplType);
CopyBytes(tbuff, 64, &pPlayer->_pSplLvl); CopyBytes(tbuff, 64, &pPlayer->_pSplLvl);
tbuff += 7; tbuff += 7; // Alignment
CopyInt64(tbuff, &pPlayer->_pMemSpells); CopyInt64(tbuff, &pPlayer->_pMemSpells);
CopyInt64(tbuff, &pPlayer->_pAblSpells); CopyInt64(tbuff, &pPlayer->_pAblSpells);
CopyInt64(tbuff, &pPlayer->_pScrlSpells); CopyInt64(tbuff, &pPlayer->_pScrlSpells);
CopyChar(tbuff, &pPlayer->_pSpellFlags); CopyChar(tbuff, &pPlayer->_pSpellFlags);
tbuff += 3; tbuff += 3; // Alignment
CopyInts(tbuff, 4, &pPlayer->_pSplHotKey); CopyInts(tbuff, 4, &pPlayer->_pSplHotKey);
CopyBytes(tbuff, 4, &pPlayer->_pSplTHotKey); CopyBytes(tbuff, 4, &pPlayer->_pSplTHotKey);
CopyInt(tbuff, &pPlayer->_pwtype); CopyInt(tbuff, &pPlayer->_pwtype);
CopyChar(tbuff, &pPlayer->_pBlockFlag); CopyChar(tbuff, &pPlayer->_pBlockFlag);
CopyChar(tbuff, &pPlayer->_pInvincible); CopyChar(tbuff, &pPlayer->_pInvincible);
CopyChar(tbuff, &pPlayer->_pLightRad); CopyChar(tbuff, &pPlayer->_pLightRad);
CopyChar(tbuff, &pPlayer->_pLvlChanging); CopyChar(tbuff, &pPlayer->_pLvlChanging);
CopyBytes(tbuff, PLR_NAME_LEN, &pPlayer->_pName); CopyBytes(tbuff, PLR_NAME_LEN, &pPlayer->_pName);
CopyChar(tbuff, &pPlayer->_pClass); CopyChar(tbuff, &pPlayer->_pClass);
tbuff += 3; tbuff += 3; // Alignment
CopyInt(tbuff, &pPlayer->_pStrength); CopyInt(tbuff, &pPlayer->_pStrength);
CopyInt(tbuff, &pPlayer->_pBaseStr); CopyInt(tbuff, &pPlayer->_pBaseStr);
CopyInt(tbuff, &pPlayer->_pMagic); CopyInt(tbuff, &pPlayer->_pMagic);
@ -346,7 +339,7 @@ void LoadPlayer(int i)
CopyInt(tbuff, &pPlayer->_pManaPer); CopyInt(tbuff, &pPlayer->_pManaPer);
CopyChar(tbuff, &pPlayer->_pLevel); CopyChar(tbuff, &pPlayer->_pLevel);
CopyChar(tbuff, &pPlayer->_pMaxLvl); CopyChar(tbuff, &pPlayer->_pMaxLvl);
tbuff += 2; tbuff += 2; // Alignment
CopyInt(tbuff, &pPlayer->_pExperience); CopyInt(tbuff, &pPlayer->_pExperience);
CopyInt(tbuff, &pPlayer->_pMaxExp); CopyInt(tbuff, &pPlayer->_pMaxExp);
CopyInt(tbuff, &pPlayer->_pNextExper); CopyInt(tbuff, &pPlayer->_pNextExper);
@ -355,6 +348,7 @@ void LoadPlayer(int i)
CopyChar(tbuff, &pPlayer->_pFireResist); CopyChar(tbuff, &pPlayer->_pFireResist);
CopyChar(tbuff, &pPlayer->_pLghtResist); CopyChar(tbuff, &pPlayer->_pLghtResist);
CopyInt(tbuff, &pPlayer->_pGold); CopyInt(tbuff, &pPlayer->_pGold);
CopyInt(tbuff, &pPlayer->_pInfraFlag); CopyInt(tbuff, &pPlayer->_pInfraFlag);
CopyInt(tbuff, &pPlayer->_pVar1); CopyInt(tbuff, &pPlayer->_pVar1);
CopyInt(tbuff, &pPlayer->_pVar2); CopyInt(tbuff, &pPlayer->_pVar2);
@ -366,50 +360,42 @@ void LoadPlayer(int i)
CopyInt(tbuff, &pPlayer->_pVar8); CopyInt(tbuff, &pPlayer->_pVar8);
CopyBytes(tbuff, NUMLEVELS, &pPlayer->_pLvlVisited); CopyBytes(tbuff, NUMLEVELS, &pPlayer->_pLvlVisited);
CopyBytes(tbuff, NUMLEVELS, &pPlayer->_pSLvlVisited); CopyBytes(tbuff, NUMLEVELS, &pPlayer->_pSLvlVisited);
tbuff += 2; tbuff += 2; // Alignment
CopyInt(tbuff, &pPlayer->_pGFXLoad);
tbuff += sizeof(DWORD) * 8; CopyInt(tbuff, &pPlayer->_pGFXLoad);
tbuff += 4 * 8; // Skip pointers _pNAnim
CopyInt(tbuff, &pPlayer->_pNFrames); CopyInt(tbuff, &pPlayer->_pNFrames);
CopyInt(tbuff, &pPlayer->_pNWidth); CopyInt(tbuff, &pPlayer->_pNWidth);
tbuff += 4 * 8; // Skip pointers _pWAnim
tbuff += sizeof(DWORD) * 8;
CopyInt(tbuff, &pPlayer->_pWFrames); CopyInt(tbuff, &pPlayer->_pWFrames);
CopyInt(tbuff, &pPlayer->_pWWidth); CopyInt(tbuff, &pPlayer->_pWWidth);
tbuff += 4 * 8; // Skip pointers _pAAnim
tbuff += sizeof(DWORD) * 8;
CopyInt(tbuff, &pPlayer->_pAFrames); CopyInt(tbuff, &pPlayer->_pAFrames);
CopyInt(tbuff, &pPlayer->_pAWidth); CopyInt(tbuff, &pPlayer->_pAWidth);
CopyInt(tbuff, &pPlayer->_pAFNum); CopyInt(tbuff, &pPlayer->_pAFNum);
tbuff += 4 * 8; // Skip pointers _pLAnim
tbuff += sizeof(DWORD) * 24; tbuff += 4 * 8; // Skip pointers _pFAnim
tbuff += 4 * 8; // Skip pointers _pTAnim
CopyInt(tbuff, &pPlayer->_pSFrames); CopyInt(tbuff, &pPlayer->_pSFrames);
CopyInt(tbuff, &pPlayer->_pSWidth); CopyInt(tbuff, &pPlayer->_pSWidth);
CopyInt(tbuff, &pPlayer->_pSFNum); CopyInt(tbuff, &pPlayer->_pSFNum);
tbuff += 4 * 8; // Skip pointers _pHAnim
tbuff += sizeof(DWORD) * 8;
CopyInt(tbuff, &pPlayer->_pHFrames); CopyInt(tbuff, &pPlayer->_pHFrames);
CopyInt(tbuff, &pPlayer->_pHWidth); CopyInt(tbuff, &pPlayer->_pHWidth);
tbuff += 4 * 8; // Skip pointers _pDAnim
tbuff += sizeof(DWORD) * 8;
CopyInt(tbuff, &pPlayer->_pDFrames); CopyInt(tbuff, &pPlayer->_pDFrames);
CopyInt(tbuff, &pPlayer->_pDWidth); CopyInt(tbuff, &pPlayer->_pDWidth);
tbuff += 4 * 8; // Skip pointers _pBAnim
tbuff += sizeof(DWORD) * 8;
CopyInt(tbuff, &pPlayer->_pBFrames); CopyInt(tbuff, &pPlayer->_pBFrames);
CopyInt(tbuff, &pPlayer->_pBWidth); CopyInt(tbuff, &pPlayer->_pBWidth);
CopyItems(NUM_INVLOC, pPlayer->InvBody);
CopyItems(NUM_INV_GRID_ELEM, pPlayer->InvList); LoadItems(NUM_INVLOC, pPlayer->InvBody);
LoadItems(NUM_INV_GRID_ELEM, pPlayer->InvList);
CopyInt(tbuff, &pPlayer->_pNumInv); CopyInt(tbuff, &pPlayer->_pNumInv);
CopyBytes(tbuff, NUM_INV_GRID_ELEM, pPlayer->InvGrid); CopyBytes(tbuff, NUM_INV_GRID_ELEM, pPlayer->InvGrid);
CopyItems(MAXBELTITEMS, pPlayer->SpdList); LoadItems(MAXBELTITEMS, pPlayer->SpdList);
CopyItem(&pPlayer->HoldItem); LoadItemData(&pPlayer->HoldItem);
CopyInt(tbuff, &pPlayer->_pIMinDam); CopyInt(tbuff, &pPlayer->_pIMinDam);
CopyInt(tbuff, &pPlayer->_pIMaxDam); CopyInt(tbuff, &pPlayer->_pIMaxDam);
CopyInt(tbuff, &pPlayer->_pIAC); CopyInt(tbuff, &pPlayer->_pIAC);
@ -417,15 +403,14 @@ void LoadPlayer(int i)
CopyInt(tbuff, &pPlayer->_pIBonusToHit); CopyInt(tbuff, &pPlayer->_pIBonusToHit);
CopyInt(tbuff, &pPlayer->_pIBonusAC); CopyInt(tbuff, &pPlayer->_pIBonusAC);
CopyInt(tbuff, &pPlayer->_pIBonusDamMod); CopyInt(tbuff, &pPlayer->_pIBonusDamMod);
tbuff += 4; tbuff += 4; // Alignment
CopyInt64(tbuff, &pPlayer->_pISpells); CopyInt64(tbuff, &pPlayer->_pISpells);
CopyInt(tbuff, &pPlayer->_pIFlags); CopyInt(tbuff, &pPlayer->_pIFlags);
CopyInt(tbuff, &pPlayer->_pIGetHit); CopyInt(tbuff, &pPlayer->_pIGetHit);
CopyChar(tbuff, &pPlayer->_pISplLvlAdd); CopyChar(tbuff, &pPlayer->_pISplLvlAdd);
CopyChar(tbuff, &pPlayer->_pISplCost); CopyChar(tbuff, &pPlayer->_pISplCost);
tbuff += 2; tbuff += 2; // Alignment
CopyInt(tbuff, &pPlayer->_pISplDur); CopyInt(tbuff, &pPlayer->_pISplDur);
CopyInt(tbuff, &pPlayer->_pIEnAc); CopyInt(tbuff, &pPlayer->_pIEnAc);
CopyInt(tbuff, &pPlayer->_pIFMinDam); CopyInt(tbuff, &pPlayer->_pIFMinDam);
@ -433,21 +418,27 @@ void LoadPlayer(int i)
CopyInt(tbuff, &pPlayer->_pILMinDam); CopyInt(tbuff, &pPlayer->_pILMinDam);
CopyInt(tbuff, &pPlayer->_pILMaxDam); CopyInt(tbuff, &pPlayer->_pILMaxDam);
CopyInt(tbuff, &pPlayer->_pOilType); CopyInt(tbuff, &pPlayer->_pOilType);
CopyChar(tbuff, &pPlayer->pTownWarps); CopyChar(tbuff, &pPlayer->pTownWarps);
CopyChar(tbuff, &pPlayer->pDungMsgs); CopyChar(tbuff, &pPlayer->pDungMsgs);
CopyChar(tbuff, &pPlayer->pLvlLoad); CopyChar(tbuff, &pPlayer->pLvlLoad);
CopyChar(tbuff, &pPlayer->pBattleNet); CopyChar(tbuff, &pPlayer->pBattleNet);
CopyChar(tbuff, &pPlayer->pManaShield); CopyChar(tbuff, &pPlayer->pManaShield);
CopyBytes(tbuff, 3, &pPlayer->bReserved); CopyBytes(tbuff, 3, &pPlayer->bReserved);
CopyShorts(tbuff, 8, &pPlayer->wReserved); CopyShorts(tbuff, 8, &pPlayer->wReserved);
CopyInt(tbuff, &pPlayer->pDiabloKillLevel); CopyInt(tbuff, &pPlayer->pDiabloKillLevel);
CopyInts(tbuff, 7, &pPlayer->dwReserved); CopyInts(tbuff, 7, &pPlayer->dwReserved);
// Omit 10 pointers // Omit pointer _pNData
// Omit pointer _pWData
// Omit pointer _pAData
// Omit pointer _pLData
// Omit pointer _pFData
// Omit pointer _pTData
// Omit pointer _pHData
// Omit pointer _pDData
// Omit pointer _pBData
// Omit pointer pReserved
} }
void LoadMonster(int i) void LoadMonster(int i)
@ -456,18 +447,14 @@ void LoadMonster(int i)
CopyInt(tbuff, &pMonster->_mMTidx); CopyInt(tbuff, &pMonster->_mMTidx);
CopyInt(tbuff, &pMonster->_mmode); CopyInt(tbuff, &pMonster->_mmode);
CopyChar(tbuff, &pMonster->_mgoal); CopyChar(tbuff, &pMonster->_mgoal);
tbuff += 3; tbuff += 3; // Alignment
CopyInt(tbuff, &pMonster->_mgoalvar1); CopyInt(tbuff, &pMonster->_mgoalvar1);
CopyInt(tbuff, &pMonster->_mgoalvar2); CopyInt(tbuff, &pMonster->_mgoalvar2);
CopyInt(tbuff, &pMonster->_mgoalvar3); CopyInt(tbuff, &pMonster->_mgoalvar3);
CopyInt(tbuff, &pMonster->field_18); CopyInt(tbuff, &pMonster->field_18);
CopyChar(tbuff, &pMonster->_pathcount); CopyChar(tbuff, &pMonster->_pathcount);
tbuff += 3; tbuff += 3; // Alignment
CopyInt(tbuff, &pMonster->_mx); CopyInt(tbuff, &pMonster->_mx);
CopyInt(tbuff, &pMonster->_my); CopyInt(tbuff, &pMonster->_my);
CopyInt(tbuff, &pMonster->_mfutx); CopyInt(tbuff, &pMonster->_mfutx);
@ -480,12 +467,11 @@ void LoadMonster(int i)
CopyInt(tbuff, &pMonster->_myvel); CopyInt(tbuff, &pMonster->_myvel);
CopyInt(tbuff, &pMonster->_mdir); CopyInt(tbuff, &pMonster->_mdir);
CopyInt(tbuff, &pMonster->_menemy); CopyInt(tbuff, &pMonster->_menemy);
CopyChar(tbuff, &pMonster->_menemyx); CopyChar(tbuff, &pMonster->_menemyx);
CopyChar(tbuff, &pMonster->_menemyy); CopyChar(tbuff, &pMonster->_menemyy);
CopyShort(tbuff, &pMonster->falign_52); CopyShort(tbuff, &pMonster->falign_52);
tbuff += 4; // Skip pointer tbuff += 4; // Skip pointer _mAnimData
CopyInt(tbuff, &pMonster->_mAnimDelay); CopyInt(tbuff, &pMonster->_mAnimDelay);
CopyInt(tbuff, &pMonster->_mAnimCnt); CopyInt(tbuff, &pMonster->_mAnimCnt);
CopyInt(tbuff, &pMonster->_mAnimLen); CopyInt(tbuff, &pMonster->_mAnimLen);
@ -506,12 +492,9 @@ void LoadMonster(int i)
CopyChar(tbuff, &pMonster->_mAi); CopyChar(tbuff, &pMonster->_mAi);
CopyChar(tbuff, &pMonster->_mint); CopyChar(tbuff, &pMonster->_mint);
CopyShort(tbuff, &pMonster->falign_9A); CopyShort(tbuff, &pMonster->falign_9A);
CopyInt(tbuff, &pMonster->_mFlags); CopyInt(tbuff, &pMonster->_mFlags);
CopyChar(tbuff, &pMonster->_msquelch); CopyChar(tbuff, &pMonster->_msquelch);
tbuff += 3; tbuff += 3; // Alignment
CopyInt(tbuff, &pMonster->falign_A4); CopyInt(tbuff, &pMonster->falign_A4);
CopyInt(tbuff, &pMonster->_lastx); CopyInt(tbuff, &pMonster->_lastx);
CopyInt(tbuff, &pMonster->_lasty); CopyInt(tbuff, &pMonster->_lasty);
@ -522,31 +505,29 @@ void LoadMonster(int i)
CopyChar(tbuff, &pMonster->_uniqtype); CopyChar(tbuff, &pMonster->_uniqtype);
CopyChar(tbuff, &pMonster->_uniqtrans); CopyChar(tbuff, &pMonster->_uniqtrans);
CopyChar(tbuff, &pMonster->_udeadval); CopyChar(tbuff, &pMonster->_udeadval);
CopyChar(tbuff, &pMonster->mWhoHit);
CopyChar(tbuff, &pMonster->mWhoHit);
CopyChar(tbuff, &pMonster->mLevel); CopyChar(tbuff, &pMonster->mLevel);
tbuff += 1; tbuff += 1; // Alignment
CopyShort(tbuff, &pMonster->mExp); CopyShort(tbuff, &pMonster->mExp);
CopyChar(tbuff, &pMonster->mHit); CopyChar(tbuff, &pMonster->mHit);
CopyChar(tbuff, &pMonster->mMinDamage); CopyChar(tbuff, &pMonster->mMinDamage);
CopyChar(tbuff, &pMonster->mMaxDamage); CopyChar(tbuff, &pMonster->mMaxDamage);
CopyChar(tbuff, &pMonster->mHit2); CopyChar(tbuff, &pMonster->mHit2);
CopyChar(tbuff, &pMonster->mMinDamage2); CopyChar(tbuff, &pMonster->mMinDamage2);
CopyChar(tbuff, &pMonster->mMaxDamage2); CopyChar(tbuff, &pMonster->mMaxDamage2);
CopyChar(tbuff, &pMonster->mArmorClass); CopyChar(tbuff, &pMonster->mArmorClass);
CopyChar(tbuff, &pMonster->falign_CB); CopyChar(tbuff, &pMonster->falign_CB);
CopyShort(tbuff, &pMonster->mMagicRes); CopyShort(tbuff, &pMonster->mMagicRes);
tbuff += 2; tbuff += 2; // Alignment
CopyInt(tbuff, &pMonster->mtalkmsg); CopyInt(tbuff, &pMonster->mtalkmsg);
CopyChar(tbuff, &pMonster->leader); CopyChar(tbuff, &pMonster->leader);
CopyChar(tbuff, &pMonster->leaderflag); CopyChar(tbuff, &pMonster->leaderflag);
CopyChar(tbuff, &pMonster->packsize); CopyChar(tbuff, &pMonster->packsize);
CopyChar(tbuff, &pMonster->mlid); CopyChar(tbuff, &pMonster->mlid);
// Omit pointer mName; // Omit pointer mName;
// Omit pointer MType; // Omit pointer MType;
// Omit pointer MData; // Omit pointer MData;
@ -573,10 +554,9 @@ void LoadMissile(int i)
CopyInt(tbuff, &pMissile->_mispllvl); CopyInt(tbuff, &pMissile->_mispllvl);
CopyInt(tbuff, &pMissile->_miDelFlag); CopyInt(tbuff, &pMissile->_miDelFlag);
CopyChar(tbuff, &pMissile->_miAnimType); CopyChar(tbuff, &pMissile->_miAnimType);
tbuff += 3; tbuff += 3; // Alignment
CopyInt(tbuff, &pMissile->_miAnimFlags); CopyInt(tbuff, &pMissile->_miAnimFlags);
tbuff += 4; tbuff += 4; // Skip pointer _miAnimData
CopyInt(tbuff, &pMissile->_miAnimDelay); CopyInt(tbuff, &pMissile->_miAnimDelay);
CopyInt(tbuff, &pMissile->_miAnimLen); CopyInt(tbuff, &pMissile->_miAnimLen);
CopyInt(tbuff, &pMissile->_miAnimWidth); CopyInt(tbuff, &pMissile->_miAnimWidth);
@ -609,12 +589,13 @@ void LoadMissile(int i)
void LoadObject(int i) void LoadObject(int i)
{ {
ObjectStruct *pObject = &object[i]; ObjectStruct *pObject = &object[i];
CopyInt(tbuff, &pObject->_otype); CopyInt(tbuff, &pObject->_otype);
CopyInt(tbuff, &pObject->_ox); CopyInt(tbuff, &pObject->_ox);
CopyInt(tbuff, &pObject->_oy); CopyInt(tbuff, &pObject->_oy);
CopyInt(tbuff, &pObject->_oLight); CopyInt(tbuff, &pObject->_oLight);
CopyInt(tbuff, &pObject->_oAnimFlag); CopyInt(tbuff, &pObject->_oAnimFlag);
tbuff += 4; tbuff += 4; // Skip pointer _oAnimData
CopyInt(tbuff, &pObject->_oAnimDelay); CopyInt(tbuff, &pObject->_oAnimDelay);
CopyInt(tbuff, &pObject->_oAnimCnt); CopyInt(tbuff, &pObject->_oAnimCnt);
CopyInt(tbuff, &pObject->_oAnimLen); CopyInt(tbuff, &pObject->_oAnimLen);
@ -622,16 +603,13 @@ void LoadObject(int i)
CopyInt(tbuff, &pObject->_oAnimWidth); CopyInt(tbuff, &pObject->_oAnimWidth);
CopyInt(tbuff, &pObject->_oAnimWidth2); CopyInt(tbuff, &pObject->_oAnimWidth2);
CopyInt(tbuff, &pObject->_oDelFlag); CopyInt(tbuff, &pObject->_oDelFlag);
CopyChar(tbuff, &pObject->_oBreak); CopyChar(tbuff, &pObject->_oBreak);
tbuff += 3; tbuff += 3; // Alignment
CopyInt(tbuff, &pObject->_oSolidFlag); CopyInt(tbuff, &pObject->_oSolidFlag);
CopyInt(tbuff, &pObject->_oMissFlag); CopyInt(tbuff, &pObject->_oMissFlag);
CopyChar(tbuff, &pObject->_oSelFlag); CopyChar(tbuff, &pObject->_oSelFlag);
tbuff += 3; tbuff += 3; // Alignment
CopyInt(tbuff, &pObject->_oPreFlag); CopyInt(tbuff, &pObject->_oPreFlag);
CopyInt(tbuff, &pObject->_oTrapFlag); CopyInt(tbuff, &pObject->_oTrapFlag);
CopyInt(tbuff, &pObject->_oDoorFlag); CopyInt(tbuff, &pObject->_oDoorFlag);
@ -649,15 +627,15 @@ void LoadObject(int i)
void LoadItem(int i) void LoadItem(int i)
{ {
CopyItem(&item[i]); LoadItemData(&item[i]);
GetItemFrm(i); GetItemFrm(i);
} }
void CopyItem(ItemStruct *pItem) void LoadItemData(ItemStruct *pItem)
{ {
CopyInt(tbuff, &pItem->_iSeed); CopyInt(tbuff, &pItem->_iSeed);
CopyShort(tbuff, &pItem->_iCreateInfo); CopyShort(tbuff, &pItem->_iCreateInfo);
tbuff += 2; tbuff += 2; // Alignment
CopyInt(tbuff, &pItem->_itype); CopyInt(tbuff, &pItem->_itype);
CopyInt(tbuff, &pItem->_ix); CopyInt(tbuff, &pItem->_ix);
CopyInt(tbuff, &pItem->_iy); CopyInt(tbuff, &pItem->_iy);
@ -669,7 +647,7 @@ void CopyItem(ItemStruct *pItem)
CopyInt(tbuff, &pItem->_iAnimWidth2); CopyInt(tbuff, &pItem->_iAnimWidth2);
CopyInt(tbuff, &pItem->_isin); CopyInt(tbuff, &pItem->_isin);
CopyChar(tbuff, &pItem->_iSelFlag); CopyChar(tbuff, &pItem->_iSelFlag);
tbuff += 3; tbuff += 3; // Alignment
CopyInt(tbuff, &pItem->_iPostDraw); CopyInt(tbuff, &pItem->_iPostDraw);
CopyInt(tbuff, &pItem->_iIdentified); CopyInt(tbuff, &pItem->_iIdentified);
CopyChar(tbuff, &pItem->_iMagical); CopyChar(tbuff, &pItem->_iMagical);
@ -677,7 +655,7 @@ void CopyItem(ItemStruct *pItem)
CopyBytes(tbuff, 64, &pItem->_iIName); CopyBytes(tbuff, 64, &pItem->_iIName);
CopyChar(tbuff, &pItem->_iLoc); CopyChar(tbuff, &pItem->_iLoc);
CopyChar(tbuff, &pItem->_iClass); CopyChar(tbuff, &pItem->_iClass);
tbuff += 1; tbuff += 1; // Alignment
CopyInt(tbuff, &pItem->_iCurs); CopyInt(tbuff, &pItem->_iCurs);
CopyInt(tbuff, &pItem->_ivalue); CopyInt(tbuff, &pItem->_ivalue);
CopyInt(tbuff, &pItem->_iIvalue); CopyInt(tbuff, &pItem->_iIvalue);
@ -708,7 +686,7 @@ void CopyItem(ItemStruct *pItem)
CopyInt(tbuff, &pItem->_iPLLight); CopyInt(tbuff, &pItem->_iPLLight);
CopyChar(tbuff, &pItem->_iSplLvlAdd); CopyChar(tbuff, &pItem->_iSplLvlAdd);
CopyChar(tbuff, &pItem->_iRequest); CopyChar(tbuff, &pItem->_iRequest);
tbuff += 2; tbuff += 2; // Alignment
CopyInt(tbuff, &pItem->_iUid); CopyInt(tbuff, &pItem->_iUid);
CopyInt(tbuff, &pItem->_iFMinDam); CopyInt(tbuff, &pItem->_iFMinDam);
CopyInt(tbuff, &pItem->_iFMaxDam); CopyInt(tbuff, &pItem->_iFMaxDam);
@ -717,7 +695,7 @@ void CopyItem(ItemStruct *pItem)
CopyInt(tbuff, &pItem->_iPLEnAc); CopyInt(tbuff, &pItem->_iPLEnAc);
CopyChar(tbuff, &pItem->_iPrePower); CopyChar(tbuff, &pItem->_iPrePower);
CopyChar(tbuff, &pItem->_iSufPower); CopyChar(tbuff, &pItem->_iSufPower);
tbuff += 2; tbuff += 2; // Alignment
CopyInt(tbuff, &pItem->_iVAdd1); CopyInt(tbuff, &pItem->_iVAdd1);
CopyInt(tbuff, &pItem->_iVMult1); CopyInt(tbuff, &pItem->_iVMult1);
CopyInt(tbuff, &pItem->_iVAdd2); CopyInt(tbuff, &pItem->_iVAdd2);
@ -725,28 +703,42 @@ void CopyItem(ItemStruct *pItem)
CopyChar(tbuff, &pItem->_iMinStr); CopyChar(tbuff, &pItem->_iMinStr);
CopyChar(tbuff, &pItem->_iMinMag); CopyChar(tbuff, &pItem->_iMinMag);
CopyChar(tbuff, &pItem->_iMinDex); CopyChar(tbuff, &pItem->_iMinDex);
tbuff += 1; tbuff += 1; // Alignment
CopyInt(tbuff, &pItem->_iStatFlag); CopyInt(tbuff, &pItem->_iStatFlag);
CopyInt(tbuff, &pItem->IDidx); CopyInt(tbuff, &pItem->IDidx);
CopyInt(tbuff, &pItem->offs016C); CopyInt(tbuff, &pItem->offs016C);
} }
void CopyItems(const int n, ItemStruct *pItem) void LoadItems(const int n, ItemStruct *pItem)
{ {
for (int i = 0; i < n; i++) { for (int i = 0; i < n; i++) {
CopyItem(&pItem[i]); LoadItemData(&pItem[i]);
} }
} }
void LoadPremium(int i) void LoadPremium(int i)
{ {
CopyItem(&premiumitem[i]); LoadItemData(&premiumitem[i]);
} }
void LoadQuest(int i) void LoadQuest(int i)
{ {
memcpy(&quests[i], tbuff, sizeof(*quests)); QuestStruct *pQuest = &quests[i];
tbuff += sizeof(*quests);
CopyChar(tbuff, &pQuest->_qlevel);
CopyChar(tbuff, &pQuest->_qtype);
CopyChar(tbuff, &pQuest->_qactive);
CopyChar(tbuff, &pQuest->_qlvltype);
CopyInt(tbuff, &pQuest->_qtx);
CopyInt(tbuff, &pQuest->_qty);
CopyChar(tbuff, &pQuest->_qslvl);
CopyChar(tbuff, &pQuest->_qidx);
CopyChar(tbuff, &pQuest->_qmsg);
CopyChar(tbuff, &pQuest->_qvar1);
CopyChar(tbuff, &pQuest->_qvar2);
tbuff += 3; // Alignment
CopyInt(tbuff, &pQuest->_qlog);
ReturnLvlX = WLoad(); ReturnLvlX = WLoad();
ReturnLvlY = WLoad(); ReturnLvlY = WLoad();
ReturnLvl = WLoad(); ReturnLvl = WLoad();
@ -756,20 +748,52 @@ void LoadQuest(int i)
void LoadLighting(int i) void LoadLighting(int i)
{ {
memcpy(&LightList[i], tbuff, sizeof(*LightList)); LightListStruct *pLight = &LightList[i];
tbuff += sizeof(*LightList);
CopyInt(tbuff, &pLight->_lx);
CopyInt(tbuff, &pLight->_ly);
CopyInt(tbuff, &pLight->_lradius);
CopyInt(tbuff, &pLight->_lid);
CopyInt(tbuff, &pLight->_ldel);
CopyInt(tbuff, &pLight->_lunflag);
CopyInt(tbuff, &pLight->field_18);
CopyInt(tbuff, &pLight->_lunx);
CopyInt(tbuff, &pLight->_luny);
CopyInt(tbuff, &pLight->_lunr);
CopyInt(tbuff, &pLight->_xoff);
CopyInt(tbuff, &pLight->_yoff);
CopyInt(tbuff, &pLight->_lflags);
} }
void LoadVision(int i) void LoadVision(int i)
{ {
memcpy(&VisionList[i], tbuff, sizeof(*VisionList)); LightListStruct *pVision = &VisionList[i];
tbuff += sizeof(*VisionList);
CopyInt(tbuff, &pVision->_lx);
CopyInt(tbuff, &pVision->_ly);
CopyInt(tbuff, &pVision->_lradius);
CopyInt(tbuff, &pVision->_lid);
CopyInt(tbuff, &pVision->_ldel);
CopyInt(tbuff, &pVision->_lunflag);
CopyInt(tbuff, &pVision->field_18);
CopyInt(tbuff, &pVision->_lunx);
CopyInt(tbuff, &pVision->_luny);
CopyInt(tbuff, &pVision->_lunr);
CopyInt(tbuff, &pVision->_xoff);
CopyInt(tbuff, &pVision->_yoff);
CopyInt(tbuff, &pVision->_lflags);
} }
void LoadPortal(int i) void LoadPortal(int i)
{ {
memcpy(&portal[i], tbuff, sizeof(*portal)); PortalStruct *pPortal = &portal[i];
tbuff += sizeof(*portal);
CopyInt(tbuff, &pPortal->open);
CopyInt(tbuff, &pPortal->x);
CopyInt(tbuff, &pPortal->y);
CopyInt(tbuff, &pPortal->level);
CopyInt(tbuff, &pPortal->ltype);
CopyInt(tbuff, &pPortal->setlvl);
} }
void SaveGame() void SaveGame()
@ -944,18 +968,14 @@ void OSave(BOOL v)
*tbuff++ = FALSE; *tbuff++ = FALSE;
} }
void SavePlayer(int i) void SavePlayer(int i)
{ {
PlayerStruct *pPlayer = &plr[i]; PlayerStruct *pPlayer = &plr[i];
CopyInt(&pPlayer->_pmode, tbuff); CopyInt(&pPlayer->_pmode, tbuff);
CopyBytes(&pPlayer->walkpath, 25, tbuff); CopyBytes(&pPlayer->walkpath, 25, tbuff);
CopyBytes(&pPlayer->plractive, 1, tbuff); CopyBytes(&pPlayer->plractive, 1, tbuff);
tbuff += 2; tbuff += 2; // Alignment
CopyInt(&pPlayer->destAction, tbuff); CopyInt(&pPlayer->destAction, tbuff);
CopyInt(&pPlayer->destParam1, tbuff); CopyInt(&pPlayer->destParam1, tbuff);
CopyInt(&pPlayer->destParam2, tbuff); CopyInt(&pPlayer->destParam2, tbuff);
@ -979,7 +999,7 @@ void SavePlayer(int i)
CopyInt(&pPlayer->_pdir, tbuff); CopyInt(&pPlayer->_pdir, tbuff);
CopyInt(&pPlayer->_nextdir, tbuff); CopyInt(&pPlayer->_nextdir, tbuff);
CopyInt(&pPlayer->_pgfxnum, tbuff); CopyInt(&pPlayer->_pgfxnum, tbuff);
tbuff += 4; // Skip pointers tbuff += 4; // Skip pointer _pAnimData
CopyInt(&pPlayer->_pAnimDelay, tbuff); CopyInt(&pPlayer->_pAnimDelay, tbuff);
CopyInt(&pPlayer->_pAnimCnt, tbuff); CopyInt(&pPlayer->_pAnimCnt, tbuff);
CopyInt(&pPlayer->_pAnimLen, tbuff); CopyInt(&pPlayer->_pAnimLen, tbuff);
@ -991,37 +1011,36 @@ void SavePlayer(int i)
CopyInt(&pPlayer->_pvid, tbuff); CopyInt(&pPlayer->_pvid, tbuff);
CopyInt(&pPlayer->_pSpell, tbuff); CopyInt(&pPlayer->_pSpell, tbuff);
CopyChar(&pPlayer->_pSplType, tbuff); CopyChar(&pPlayer->_pSplType, tbuff);
CopyChar(&pPlayer->_pSplFrom, tbuff); CopyChar(&pPlayer->_pSplFrom, tbuff);
tbuff += 2; tbuff += 2; // Alignment
CopyInt(&pPlayer->_pTSpell, tbuff); CopyInt(&pPlayer->_pTSpell, tbuff);
CopyChar(&pPlayer->_pTSplType, tbuff); CopyChar(&pPlayer->_pTSplType, tbuff);
tbuff += 3; tbuff += 3; // Alignment
CopyInt(&pPlayer->_pRSpell, tbuff); CopyInt(&pPlayer->_pRSpell, tbuff);
CopyChar(&pPlayer->_pRSplType, tbuff); CopyChar(&pPlayer->_pRSplType, tbuff);
tbuff += 3; tbuff += 3; // Alignment
CopyInt(&pPlayer->_pSBkSpell, tbuff); CopyInt(&pPlayer->_pSBkSpell, tbuff);
CopyChar(&pPlayer->_pSBkSplType, tbuff); CopyChar(&pPlayer->_pSBkSplType, tbuff);
CopyBytes(&pPlayer->_pSplLvl, 64, tbuff); CopyBytes(&pPlayer->_pSplLvl, 64, tbuff);
tbuff += 7; tbuff += 7; // Alignment
CopyInt64(&pPlayer->_pMemSpells, tbuff); CopyInt64(&pPlayer->_pMemSpells, tbuff);
CopyInt64(&pPlayer->_pAblSpells, tbuff); CopyInt64(&pPlayer->_pAblSpells, tbuff);
CopyInt64(&pPlayer->_pScrlSpells, tbuff); CopyInt64(&pPlayer->_pScrlSpells, tbuff);
CopyChar(&pPlayer->_pSpellFlags, tbuff); CopyChar(&pPlayer->_pSpellFlags, tbuff);
tbuff += 3; tbuff += 3; // Alignment
CopyInts(&pPlayer->_pSplHotKey, 4, tbuff); CopyInts(&pPlayer->_pSplHotKey, 4, tbuff);
CopyBytes(&pPlayer->_pSplTHotKey, 4, tbuff); CopyBytes(&pPlayer->_pSplTHotKey, 4, tbuff);
CopyInt(&pPlayer->_pwtype, tbuff); CopyInt(&pPlayer->_pwtype, tbuff);
CopyChar(&pPlayer->_pBlockFlag, tbuff); CopyChar(&pPlayer->_pBlockFlag, tbuff);
CopyChar(&pPlayer->_pInvincible, tbuff); CopyChar(&pPlayer->_pInvincible, tbuff);
CopyChar(&pPlayer->_pLightRad, tbuff); CopyChar(&pPlayer->_pLightRad, tbuff);
CopyChar(&pPlayer->_pLvlChanging, tbuff); CopyChar(&pPlayer->_pLvlChanging, tbuff);
CopyBytes(&pPlayer->_pName, PLR_NAME_LEN, tbuff); CopyBytes(&pPlayer->_pName, PLR_NAME_LEN, tbuff);
CopyChar(&pPlayer->_pClass, tbuff); CopyChar(&pPlayer->_pClass, tbuff);
tbuff += 3; tbuff += 3; // Alignment
CopyInt(&pPlayer->_pStrength, tbuff); CopyInt(&pPlayer->_pStrength, tbuff);
CopyInt(&pPlayer->_pBaseStr, tbuff); CopyInt(&pPlayer->_pBaseStr, tbuff);
CopyInt(&pPlayer->_pMagic, tbuff); CopyInt(&pPlayer->_pMagic, tbuff);
@ -1045,7 +1064,7 @@ void SavePlayer(int i)
CopyInt(&pPlayer->_pManaPer, tbuff); CopyInt(&pPlayer->_pManaPer, tbuff);
CopyChar(&pPlayer->_pLevel, tbuff); CopyChar(&pPlayer->_pLevel, tbuff);
CopyChar(&pPlayer->_pMaxLvl, tbuff); CopyChar(&pPlayer->_pMaxLvl, tbuff);
tbuff += 2; tbuff += 2; // Alignment
CopyInt(&pPlayer->_pExperience, tbuff); CopyInt(&pPlayer->_pExperience, tbuff);
CopyInt(&pPlayer->_pMaxExp, tbuff); CopyInt(&pPlayer->_pMaxExp, tbuff);
CopyInt(&pPlayer->_pNextExper, tbuff); CopyInt(&pPlayer->_pNextExper, tbuff);
@ -1054,6 +1073,7 @@ void SavePlayer(int i)
CopyChar(&pPlayer->_pFireResist, tbuff); CopyChar(&pPlayer->_pFireResist, tbuff);
CopyChar(&pPlayer->_pLghtResist, tbuff); CopyChar(&pPlayer->_pLghtResist, tbuff);
CopyInt(&pPlayer->_pGold, tbuff); CopyInt(&pPlayer->_pGold, tbuff);
CopyInt(&pPlayer->_pInfraFlag, tbuff); CopyInt(&pPlayer->_pInfraFlag, tbuff);
CopyInt(&pPlayer->_pVar1, tbuff); CopyInt(&pPlayer->_pVar1, tbuff);
CopyInt(&pPlayer->_pVar2, tbuff); CopyInt(&pPlayer->_pVar2, tbuff);
@ -1065,50 +1085,42 @@ void SavePlayer(int i)
CopyInt(&pPlayer->_pVar8, tbuff); CopyInt(&pPlayer->_pVar8, tbuff);
CopyBytes(&pPlayer->_pLvlVisited, NUMLEVELS, tbuff); CopyBytes(&pPlayer->_pLvlVisited, NUMLEVELS, tbuff);
CopyBytes(&pPlayer->_pSLvlVisited, NUMLEVELS, tbuff); // only 10 used CopyBytes(&pPlayer->_pSLvlVisited, NUMLEVELS, tbuff); // only 10 used
tbuff += 2; tbuff += 2; // Alignment
CopyInt(&pPlayer->_pGFXLoad, tbuff);
tbuff += sizeof(DWORD) * 8; // Skip 8 pointers CopyInt(&pPlayer->_pGFXLoad, tbuff);
tbuff += 4 * 8; // Skip pointers _pNAnim
CopyInt(&pPlayer->_pNFrames, tbuff); CopyInt(&pPlayer->_pNFrames, tbuff);
CopyInt(&pPlayer->_pNWidth, tbuff); CopyInt(&pPlayer->_pNWidth, tbuff);
tbuff += 4 * 8; // Skip pointers _pWAnim
tbuff += sizeof(DWORD) * 8; // Skip 8 pointers
CopyInt(&pPlayer->_pWFrames, tbuff); CopyInt(&pPlayer->_pWFrames, tbuff);
CopyInt(&pPlayer->_pWWidth, tbuff); CopyInt(&pPlayer->_pWWidth, tbuff);
tbuff += 4 * 8; // Skip pointers _pAAnim
tbuff += sizeof(DWORD) * 8; // Skip 8 pointers
CopyInt(&pPlayer->_pAFrames, tbuff); CopyInt(&pPlayer->_pAFrames, tbuff);
CopyInt(&pPlayer->_pAWidth, tbuff); CopyInt(&pPlayer->_pAWidth, tbuff);
CopyInt(&pPlayer->_pAFNum, tbuff); CopyInt(&pPlayer->_pAFNum, tbuff);
tbuff += 4 * 8; // Skip pointers _pLAnim
tbuff += sizeof(DWORD) * 24; // Skip 24 pointers tbuff += 4 * 8; // Skip pointers _pFAnim
tbuff += 4 * 8; // Skip pointers _pTAnim
CopyInt(&pPlayer->_pSFrames, tbuff); CopyInt(&pPlayer->_pSFrames, tbuff);
CopyInt(&pPlayer->_pSWidth, tbuff); CopyInt(&pPlayer->_pSWidth, tbuff);
CopyInt(&pPlayer->_pSFNum, tbuff); CopyInt(&pPlayer->_pSFNum, tbuff);
tbuff += 4 * 8; // Skip pointers _pHAnim
tbuff += sizeof(DWORD) * 8; // Skip 8 pointers
CopyInt(&pPlayer->_pHFrames, tbuff); CopyInt(&pPlayer->_pHFrames, tbuff);
CopyInt(&pPlayer->_pHWidth, tbuff); CopyInt(&pPlayer->_pHWidth, tbuff);
tbuff += 4 * 8; // Skip pointers _pDAnim
tbuff += sizeof(DWORD) * 8; // Skip 8 pointers
CopyInt(&pPlayer->_pDFrames, tbuff); CopyInt(&pPlayer->_pDFrames, tbuff);
CopyInt(&pPlayer->_pDWidth, tbuff); CopyInt(&pPlayer->_pDWidth, tbuff);
tbuff += 4 * 8; // Skip pointers _pBAnim
tbuff += sizeof(DWORD) * 8; // Skip 8 pointers
CopyInt(&pPlayer->_pBFrames, tbuff); CopyInt(&pPlayer->_pBFrames, tbuff);
CopyInt(&pPlayer->_pBWidth, tbuff); CopyInt(&pPlayer->_pBWidth, tbuff);
SaveItems(pPlayer->InvBody, NUM_INVLOC); SaveItems(pPlayer->InvBody, NUM_INVLOC);
SaveItems(pPlayer->InvList, NUM_INV_GRID_ELEM); SaveItems(pPlayer->InvList, NUM_INV_GRID_ELEM);
CopyInt(&pPlayer->_pNumInv, tbuff); CopyInt(&pPlayer->_pNumInv, tbuff);
CopyBytes(pPlayer->InvGrid, NUM_INV_GRID_ELEM, tbuff); CopyBytes(pPlayer->InvGrid, NUM_INV_GRID_ELEM, tbuff);
SaveItems(pPlayer->SpdList, MAXBELTITEMS); SaveItems(pPlayer->SpdList, MAXBELTITEMS);
SaveItem(&pPlayer->HoldItem); SaveItem(&pPlayer->HoldItem);
CopyInt(&pPlayer->_pIMinDam, tbuff); CopyInt(&pPlayer->_pIMinDam, tbuff);
CopyInt(&pPlayer->_pIMaxDam, tbuff); CopyInt(&pPlayer->_pIMaxDam, tbuff);
CopyInt(&pPlayer->_pIAC, tbuff); CopyInt(&pPlayer->_pIAC, tbuff);
@ -1116,15 +1128,15 @@ void SavePlayer(int i)
CopyInt(&pPlayer->_pIBonusToHit, tbuff); CopyInt(&pPlayer->_pIBonusToHit, tbuff);
CopyInt(&pPlayer->_pIBonusAC, tbuff); CopyInt(&pPlayer->_pIBonusAC, tbuff);
CopyInt(&pPlayer->_pIBonusDamMod, tbuff); CopyInt(&pPlayer->_pIBonusDamMod, tbuff);
tbuff += 4; tbuff += 4; // Alignment
CopyInt64(&pPlayer->_pISpells, tbuff); CopyInt64(&pPlayer->_pISpells, tbuff);
CopyInt(&pPlayer->_pIFlags, tbuff); CopyInt(&pPlayer->_pIFlags, tbuff);
CopyInt(&pPlayer->_pIGetHit, tbuff); CopyInt(&pPlayer->_pIGetHit, tbuff);
CopyChar(&pPlayer->_pISplLvlAdd, tbuff); CopyChar(&pPlayer->_pISplLvlAdd, tbuff);
CopyChar(&pPlayer->_pISplCost, tbuff); CopyChar(&pPlayer->_pISplCost, tbuff);
tbuff += 2; tbuff += 2; // Alignment
CopyInt(&pPlayer->_pISplDur, tbuff); CopyInt(&pPlayer->_pISplDur, tbuff);
CopyInt(&pPlayer->_pIEnAc, tbuff); CopyInt(&pPlayer->_pIEnAc, tbuff);
CopyInt(&pPlayer->_pIFMinDam, tbuff); CopyInt(&pPlayer->_pIFMinDam, tbuff);
@ -1132,21 +1144,27 @@ void SavePlayer(int i)
CopyInt(&pPlayer->_pILMinDam, tbuff); CopyInt(&pPlayer->_pILMinDam, tbuff);
CopyInt(&pPlayer->_pILMaxDam, tbuff); CopyInt(&pPlayer->_pILMaxDam, tbuff);
CopyInt(&pPlayer->_pOilType, tbuff); CopyInt(&pPlayer->_pOilType, tbuff);
CopyChar(&pPlayer->pTownWarps, tbuff); CopyChar(&pPlayer->pTownWarps, tbuff);
CopyChar(&pPlayer->pDungMsgs, tbuff); CopyChar(&pPlayer->pDungMsgs, tbuff);
CopyChar(&pPlayer->pLvlLoad, tbuff); CopyChar(&pPlayer->pLvlLoad, tbuff);
CopyChar(&pPlayer->pBattleNet, tbuff); CopyChar(&pPlayer->pBattleNet, tbuff);
CopyChar(&pPlayer->pManaShield, tbuff); CopyChar(&pPlayer->pManaShield, tbuff);
CopyBytes(&pPlayer->bReserved, 3, tbuff); CopyBytes(&pPlayer->bReserved, 3, tbuff);
CopyShorts(&pPlayer->wReserved, 8, tbuff); CopyShorts(&pPlayer->wReserved, 8, tbuff);
CopyInt(&pPlayer->pDiabloKillLevel, tbuff); CopyInt(&pPlayer->pDiabloKillLevel, tbuff);
CopyInts(&pPlayer->dwReserved, 7, tbuff); CopyInts(&pPlayer->dwReserved, 7, tbuff);
// Omit 10 pointers // Omit pointer _pNData
// Omit pointer _pWData
// Omit pointer _pAData
// Omit pointer _pLData
// Omit pointer _pFData
// Omit pointer _pTData
// Omit pointer _pHData
// Omit pointer _pDData
// Omit pointer _pBData
// Omit pointer pReserved
} }
void SaveMonster(int i) void SaveMonster(int i)
@ -1155,18 +1173,14 @@ void SaveMonster(int i)
CopyInt(&pMonster->_mMTidx, tbuff); CopyInt(&pMonster->_mMTidx, tbuff);
CopyInt(&pMonster->_mmode, tbuff); CopyInt(&pMonster->_mmode, tbuff);
CopyChar(&pMonster->_mgoal, tbuff); CopyChar(&pMonster->_mgoal, tbuff);
tbuff += 3; tbuff += 3; // Alignment
CopyInt(&pMonster->_mgoalvar1, tbuff); CopyInt(&pMonster->_mgoalvar1, tbuff);
CopyInt(&pMonster->_mgoalvar2, tbuff); CopyInt(&pMonster->_mgoalvar2, tbuff);
CopyInt(&pMonster->_mgoalvar3, tbuff); CopyInt(&pMonster->_mgoalvar3, tbuff);
CopyInt(&pMonster->field_18, tbuff); CopyInt(&pMonster->field_18, tbuff);
CopyChar(&pMonster->_pathcount, tbuff); CopyChar(&pMonster->_pathcount, tbuff);
tbuff += 3; tbuff += 3; // Alignment
CopyInt(&pMonster->_mx, tbuff); CopyInt(&pMonster->_mx, tbuff);
CopyInt(&pMonster->_my, tbuff); CopyInt(&pMonster->_my, tbuff);
CopyInt(&pMonster->_mfutx, tbuff); CopyInt(&pMonster->_mfutx, tbuff);
@ -1179,12 +1193,11 @@ void SaveMonster(int i)
CopyInt(&pMonster->_myvel, tbuff); CopyInt(&pMonster->_myvel, tbuff);
CopyInt(&pMonster->_mdir, tbuff); CopyInt(&pMonster->_mdir, tbuff);
CopyInt(&pMonster->_menemy, tbuff); CopyInt(&pMonster->_menemy, tbuff);
CopyChar(&pMonster->_menemyx, tbuff); CopyChar(&pMonster->_menemyx, tbuff);
CopyChar(&pMonster->_menemyy, tbuff); CopyChar(&pMonster->_menemyy, tbuff);
CopyShort(&pMonster->falign_52, tbuff); CopyShort(&pMonster->falign_52, tbuff);
tbuff += 4; // Skip pointer tbuff += 4; // Skip pointer _mAnimData
CopyInt(&pMonster->_mAnimDelay, tbuff); CopyInt(&pMonster->_mAnimDelay, tbuff);
CopyInt(&pMonster->_mAnimCnt, tbuff); CopyInt(&pMonster->_mAnimCnt, tbuff);
CopyInt(&pMonster->_mAnimLen, tbuff); CopyInt(&pMonster->_mAnimLen, tbuff);
@ -1205,12 +1218,9 @@ void SaveMonster(int i)
CopyChar(&pMonster->_mAi, tbuff); CopyChar(&pMonster->_mAi, tbuff);
CopyChar(&pMonster->_mint, tbuff); CopyChar(&pMonster->_mint, tbuff);
CopyShort(&pMonster->falign_9A, tbuff); CopyShort(&pMonster->falign_9A, tbuff);
CopyInt(&pMonster->_mFlags, tbuff); CopyInt(&pMonster->_mFlags, tbuff);
CopyChar(&pMonster->_msquelch, tbuff); CopyChar(&pMonster->_msquelch, tbuff);
tbuff += 3; tbuff += 3; // Alignment
CopyInt(&pMonster->falign_A4, tbuff); CopyInt(&pMonster->falign_A4, tbuff);
CopyInt(&pMonster->_lastx, tbuff); CopyInt(&pMonster->_lastx, tbuff);
CopyInt(&pMonster->_lasty, tbuff); CopyInt(&pMonster->_lasty, tbuff);
@ -1221,27 +1231,24 @@ void SaveMonster(int i)
CopyChar(&pMonster->_uniqtype, tbuff); CopyChar(&pMonster->_uniqtype, tbuff);
CopyChar(&pMonster->_uniqtrans, tbuff); CopyChar(&pMonster->_uniqtrans, tbuff);
CopyChar(&pMonster->_udeadval, tbuff); CopyChar(&pMonster->_udeadval, tbuff);
CopyChar(&pMonster->mWhoHit, tbuff);
CopyChar(&pMonster->mWhoHit, tbuff);
CopyChar(&pMonster->mLevel, tbuff); CopyChar(&pMonster->mLevel, tbuff);
tbuff += 1; tbuff += 1; // Alignment
CopyShort(&pMonster->mExp, tbuff); CopyShort(&pMonster->mExp, tbuff);
CopyChar(&pMonster->mHit, tbuff); CopyChar(&pMonster->mHit, tbuff);
CopyChar(&pMonster->mMinDamage, tbuff); CopyChar(&pMonster->mMinDamage, tbuff);
CopyChar(&pMonster->mMaxDamage, tbuff); CopyChar(&pMonster->mMaxDamage, tbuff);
CopyChar(&pMonster->mHit2, tbuff); CopyChar(&pMonster->mHit2, tbuff);
CopyChar(&pMonster->mMinDamage2, tbuff); CopyChar(&pMonster->mMinDamage2, tbuff);
CopyChar(&pMonster->mMaxDamage2, tbuff); CopyChar(&pMonster->mMaxDamage2, tbuff);
CopyChar(&pMonster->mArmorClass, tbuff); CopyChar(&pMonster->mArmorClass, tbuff);
CopyChar(&pMonster->falign_CB, tbuff); CopyChar(&pMonster->falign_CB, tbuff);
CopyShort(&pMonster->mMagicRes, tbuff); CopyShort(&pMonster->mMagicRes, tbuff);
tbuff += 2; tbuff += 2; // Alignment
CopyInt(&pMonster->mtalkmsg, tbuff); CopyInt(&pMonster->mtalkmsg, tbuff);
CopyChar(&pMonster->leader, tbuff); CopyChar(&pMonster->leader, tbuff);
CopyChar(&pMonster->leaderflag, tbuff); CopyChar(&pMonster->leaderflag, tbuff);
CopyChar(&pMonster->packsize, tbuff); CopyChar(&pMonster->packsize, tbuff);
@ -1271,10 +1278,9 @@ void SaveMissile(int i)
CopyInt(&pMissile->_mispllvl, tbuff); CopyInt(&pMissile->_mispllvl, tbuff);
CopyInt(&pMissile->_miDelFlag, tbuff); CopyInt(&pMissile->_miDelFlag, tbuff);
CopyChar(&pMissile->_miAnimType, tbuff); CopyChar(&pMissile->_miAnimType, tbuff);
tbuff += 3; tbuff += 3; // Alignment
CopyInt(&pMissile->_miAnimFlags, tbuff); CopyInt(&pMissile->_miAnimFlags, tbuff);
tbuff += 4; tbuff += 4; // Skip pointer _miAnimData
CopyInt(&pMissile->_miAnimDelay, tbuff); CopyInt(&pMissile->_miAnimDelay, tbuff);
CopyInt(&pMissile->_miAnimLen, tbuff); CopyInt(&pMissile->_miAnimLen, tbuff);
CopyInt(&pMissile->_miAnimWidth, tbuff); CopyInt(&pMissile->_miAnimWidth, tbuff);
@ -1307,12 +1313,13 @@ void SaveMissile(int i)
void SaveObject(int i) void SaveObject(int i)
{ {
ObjectStruct *pObject = &object[i]; ObjectStruct *pObject = &object[i];
CopyInt(&pObject->_otype, tbuff); CopyInt(&pObject->_otype, tbuff);
CopyInt(&pObject->_ox, tbuff); CopyInt(&pObject->_ox, tbuff);
CopyInt(&pObject->_oy, tbuff); CopyInt(&pObject->_oy, tbuff);
CopyInt(&pObject->_oLight, tbuff); CopyInt(&pObject->_oLight, tbuff);
CopyInt(&pObject->_oAnimFlag, tbuff); CopyInt(&pObject->_oAnimFlag, tbuff);
tbuff += 4; tbuff += 4; // Skip pointer _oAnimData
CopyInt(&pObject->_oAnimDelay, tbuff); CopyInt(&pObject->_oAnimDelay, tbuff);
CopyInt(&pObject->_oAnimCnt, tbuff); CopyInt(&pObject->_oAnimCnt, tbuff);
CopyInt(&pObject->_oAnimLen, tbuff); CopyInt(&pObject->_oAnimLen, tbuff);
@ -1320,16 +1327,13 @@ void SaveObject(int i)
CopyInt(&pObject->_oAnimWidth, tbuff); CopyInt(&pObject->_oAnimWidth, tbuff);
CopyInt(&pObject->_oAnimWidth2, tbuff); CopyInt(&pObject->_oAnimWidth2, tbuff);
CopyInt(&pObject->_oDelFlag, tbuff); CopyInt(&pObject->_oDelFlag, tbuff);
CopyChar(&pObject->_oBreak, tbuff); CopyChar(&pObject->_oBreak, tbuff);
tbuff += 3; tbuff += 3; // Alignment
CopyInt(&pObject->_oSolidFlag, tbuff); CopyInt(&pObject->_oSolidFlag, tbuff);
CopyInt(&pObject->_oMissFlag, tbuff); CopyInt(&pObject->_oMissFlag, tbuff);
CopyChar(&pObject->_oSelFlag, tbuff); CopyChar(&pObject->_oSelFlag, tbuff);
tbuff += 3; tbuff += 3; // Alignment
CopyInt(&pObject->_oPreFlag, tbuff); CopyInt(&pObject->_oPreFlag, tbuff);
CopyInt(&pObject->_oTrapFlag, tbuff); CopyInt(&pObject->_oTrapFlag, tbuff);
CopyInt(&pObject->_oDoorFlag, tbuff); CopyInt(&pObject->_oDoorFlag, tbuff);
@ -1349,7 +1353,7 @@ void SaveItem(ItemStruct *pItem)
{ {
CopyInt(&pItem->_iSeed, tbuff); CopyInt(&pItem->_iSeed, tbuff);
CopyShort(&pItem->_iCreateInfo, tbuff); CopyShort(&pItem->_iCreateInfo, tbuff);
tbuff += 2; tbuff += 2; // Alignment
CopyInt(&pItem->_itype, tbuff); CopyInt(&pItem->_itype, tbuff);
CopyInt(&pItem->_ix, tbuff); CopyInt(&pItem->_ix, tbuff);
CopyInt(&pItem->_iy, tbuff); CopyInt(&pItem->_iy, tbuff);
@ -1358,10 +1362,10 @@ void SaveItem(ItemStruct *pItem)
CopyInt(&pItem->_iAnimLen, tbuff); CopyInt(&pItem->_iAnimLen, tbuff);
CopyInt(&pItem->_iAnimFrame, tbuff); CopyInt(&pItem->_iAnimFrame, tbuff);
CopyInt(&pItem->_iAnimWidth, tbuff); CopyInt(&pItem->_iAnimWidth, tbuff);
CopyInt(&pItem->_iAnimWidth2, tbuff); // width 2? CopyInt(&pItem->_iAnimWidth2, tbuff);
CopyInt(&pItem->_isin, tbuff); // set when item is flagged for deletion, deprecated in 1.02 CopyInt(&pItem->_isin, tbuff);
CopyChar(&pItem->_iSelFlag, tbuff); CopyChar(&pItem->_iSelFlag, tbuff);
tbuff += 3; tbuff += 3; // Alignment
CopyInt(&pItem->_iPostDraw, tbuff); CopyInt(&pItem->_iPostDraw, tbuff);
CopyInt(&pItem->_iIdentified, tbuff); CopyInt(&pItem->_iIdentified, tbuff);
CopyChar(&pItem->_iMagical, tbuff); CopyChar(&pItem->_iMagical, tbuff);
@ -1369,7 +1373,7 @@ void SaveItem(ItemStruct *pItem)
CopyBytes(&pItem->_iIName, 64, tbuff); CopyBytes(&pItem->_iIName, 64, tbuff);
CopyChar(&pItem->_iLoc, tbuff); CopyChar(&pItem->_iLoc, tbuff);
CopyChar(&pItem->_iClass, tbuff); CopyChar(&pItem->_iClass, tbuff);
tbuff += 1; tbuff += 1; // Alignment
CopyInt(&pItem->_iCurs, tbuff); CopyInt(&pItem->_iCurs, tbuff);
CopyInt(&pItem->_ivalue, tbuff); CopyInt(&pItem->_ivalue, tbuff);
CopyInt(&pItem->_iIvalue, tbuff); CopyInt(&pItem->_iIvalue, tbuff);
@ -1400,7 +1404,7 @@ void SaveItem(ItemStruct *pItem)
CopyInt(&pItem->_iPLLight, tbuff); CopyInt(&pItem->_iPLLight, tbuff);
CopyChar(&pItem->_iSplLvlAdd, tbuff); CopyChar(&pItem->_iSplLvlAdd, tbuff);
CopyChar(&pItem->_iRequest, tbuff); CopyChar(&pItem->_iRequest, tbuff);
tbuff += 2; tbuff += 2; // Alignment
CopyInt(&pItem->_iUid, tbuff); CopyInt(&pItem->_iUid, tbuff);
CopyInt(&pItem->_iFMinDam, tbuff); CopyInt(&pItem->_iFMinDam, tbuff);
CopyInt(&pItem->_iFMaxDam, tbuff); CopyInt(&pItem->_iFMaxDam, tbuff);
@ -1409,7 +1413,7 @@ void SaveItem(ItemStruct *pItem)
CopyInt(&pItem->_iPLEnAc, tbuff); CopyInt(&pItem->_iPLEnAc, tbuff);
CopyChar(&pItem->_iPrePower, tbuff); CopyChar(&pItem->_iPrePower, tbuff);
CopyChar(&pItem->_iSufPower, tbuff); CopyChar(&pItem->_iSufPower, tbuff);
tbuff += 2; tbuff += 2; // Alignment
CopyInt(&pItem->_iVAdd1, tbuff); CopyInt(&pItem->_iVAdd1, tbuff);
CopyInt(&pItem->_iVMult1, tbuff); CopyInt(&pItem->_iVMult1, tbuff);
CopyInt(&pItem->_iVAdd2, tbuff); CopyInt(&pItem->_iVAdd2, tbuff);
@ -1417,7 +1421,7 @@ void SaveItem(ItemStruct *pItem)
CopyChar(&pItem->_iMinStr, tbuff); CopyChar(&pItem->_iMinStr, tbuff);
CopyChar(&pItem->_iMinMag, tbuff); CopyChar(&pItem->_iMinMag, tbuff);
CopyChar(&pItem->_iMinDex, tbuff); CopyChar(&pItem->_iMinDex, tbuff);
tbuff += 1; tbuff += 1; // Alignment
CopyInt(&pItem->_iStatFlag, tbuff); CopyInt(&pItem->_iStatFlag, tbuff);
CopyInt(&pItem->IDidx, tbuff); CopyInt(&pItem->IDidx, tbuff);
CopyInt(&pItem->offs016C, tbuff); CopyInt(&pItem->offs016C, tbuff);
@ -1437,8 +1441,22 @@ void SavePremium(int i)
void SaveQuest(int i) void SaveQuest(int i)
{ {
memcpy(tbuff, &quests[i], sizeof(*quests)); QuestStruct *pQuest = &quests[i];
tbuff += sizeof(*quests);
CopyChar(&pQuest->_qlevel, tbuff);
CopyChar(&pQuest->_qtype, tbuff);
CopyChar(&pQuest->_qactive, tbuff);
CopyChar(&pQuest->_qlvltype, tbuff);
CopyInt(&pQuest->_qtx, tbuff);
CopyInt(&pQuest->_qty, tbuff);
CopyChar(&pQuest->_qslvl, tbuff);
CopyChar(&pQuest->_qidx, tbuff);
CopyChar(&pQuest->_qmsg, tbuff);
CopyChar(&pQuest->_qvar1, tbuff);
CopyChar(&pQuest->_qvar2, tbuff);
tbuff += 3; // Alignment
CopyInt(&pQuest->_qlog, tbuff);
WSave(ReturnLvlX); WSave(ReturnLvlX);
WSave(ReturnLvlY); WSave(ReturnLvlY);
WSave(ReturnLvl); WSave(ReturnLvl);
@ -1448,20 +1466,52 @@ void SaveQuest(int i)
void SaveLighting(int i) void SaveLighting(int i)
{ {
memcpy(tbuff, &LightList[i], sizeof(*LightList)); LightListStruct *pLight = &LightList[i];
tbuff += sizeof(*LightList);
CopyInt(&pLight->_lx, tbuff);
CopyInt(&pLight->_ly, tbuff);
CopyInt(&pLight->_lradius, tbuff);
CopyInt(&pLight->_lid, tbuff);
CopyInt(&pLight->_ldel, tbuff);
CopyInt(&pLight->_lunflag, tbuff);
CopyInt(&pLight->field_18, tbuff);
CopyInt(&pLight->_lunx, tbuff);
CopyInt(&pLight->_luny, tbuff);
CopyInt(&pLight->_lunr, tbuff);
CopyInt(&pLight->_xoff, tbuff);
CopyInt(&pLight->_yoff, tbuff);
CopyInt(&pLight->_lflags, tbuff);
} }
void SaveVision(int i) void SaveVision(int i)
{ {
memcpy(tbuff, &VisionList[i], sizeof(*VisionList)); LightListStruct *pVision = &VisionList[i];
tbuff += sizeof(*VisionList);
CopyInt(&pVision->_lx, tbuff);
CopyInt(&pVision->_ly, tbuff);
CopyInt(&pVision->_lradius, tbuff);
CopyInt(&pVision->_lid, tbuff);
CopyInt(&pVision->_ldel, tbuff);
CopyInt(&pVision->_lunflag, tbuff);
CopyInt(&pVision->field_18, tbuff);
CopyInt(&pVision->_lunx, tbuff);
CopyInt(&pVision->_luny, tbuff);
CopyInt(&pVision->_lunr, tbuff);
CopyInt(&pVision->_xoff, tbuff);
CopyInt(&pVision->_yoff, tbuff);
CopyInt(&pVision->_lflags, tbuff);
} }
void SavePortal(int i) void SavePortal(int i)
{ {
memcpy(tbuff, &portal[i], sizeof(*portal)); PortalStruct *pPortal = &portal[i];
tbuff += sizeof(*portal);
CopyInt(&pPortal->open, tbuff);
CopyInt(&pPortal->x, tbuff);
CopyInt(&pPortal->y, tbuff);
CopyInt(&pPortal->level, tbuff);
CopyInt(&pPortal->ltype, tbuff);
CopyInt(&pPortal->setlvl, tbuff);
} }
void SaveLevel() void SaveLevel()

4
Source/loadsave.h

@ -9,8 +9,8 @@ char BLoad();
int WLoad(); int WLoad();
int ILoad(); int ILoad();
BOOL OLoad(); BOOL OLoad();
void CopyItems(const int n, ItemStruct *pItem); void LoadItems(const int n, ItemStruct *pItem);
void CopyItem(ItemStruct *pItem); void LoadItemData(ItemStruct *pItem);
void SaveItem(ItemStruct *pItem); void SaveItem(ItemStruct *pItem);
void SaveItems(ItemStruct *pItem, const int n); void SaveItems(ItemStruct *pItem, const int n);

32
SourceX/DiabloUI/diabloui.cpp

@ -216,22 +216,22 @@ bool UiFocusNavigation(SDL_Event *event)
if (event->type == SDL_QUIT) if (event->type == SDL_QUIT)
exit(0); exit(0);
switch(event->type) { switch (event->type) {
case SDL_KEYUP: case SDL_KEYUP:
case SDL_MOUSEBUTTONUP: case SDL_MOUSEBUTTONUP:
case SDL_MOUSEMOTION: case SDL_MOUSEMOTION:
case SDL_MOUSEWHEEL: case SDL_MOUSEWHEEL:
case SDL_JOYBUTTONUP: case SDL_JOYBUTTONUP:
case SDL_JOYAXISMOTION: case SDL_JOYAXISMOTION:
case SDL_JOYBALLMOTION: case SDL_JOYBALLMOTION:
case SDL_JOYHATMOTION: case SDL_JOYHATMOTION:
case SDL_FINGERUP: case SDL_FINGERUP:
case SDL_FINGERMOTION: case SDL_FINGERMOTION:
case SDL_CONTROLLERBUTTONUP: case SDL_CONTROLLERBUTTONUP:
case SDL_CONTROLLERAXISMOTION: case SDL_CONTROLLERAXISMOTION:
case SDL_SYSWMEVENT: case SDL_SYSWMEVENT:
case SDL_WINDOWEVENT: case SDL_WINDOWEVENT:
mainmenu_restart_repintro(); mainmenu_restart_repintro();
} }
if (event->type == SDL_KEYDOWN) { if (event->type == SDL_KEYDOWN) {

6
structs.h

@ -655,7 +655,6 @@ typedef struct ObjDataStruct {
BOOL oTrapFlag; BOOL oTrapFlag;
} ObjDataStruct; } ObjDataStruct;
#pragma pack(push, 4)
typedef struct ObjectStruct { typedef struct ObjectStruct {
int _otype; int _otype;
int _ox; int _ox;
@ -688,13 +687,11 @@ typedef struct ObjectStruct {
int _oVar7; int _oVar7;
int _oVar8; int _oVar8;
} ObjectStruct; } ObjectStruct;
#pragma pack(pop)
////////////////////////////////////////////////// //////////////////////////////////////////////////
// portal // portal
////////////////////////////////////////////////// //////////////////////////////////////////////////
#pragma pack(push, 4)
typedef struct PortalStruct { typedef struct PortalStruct {
BOOL open; BOOL open;
int x; int x;
@ -703,7 +700,6 @@ typedef struct PortalStruct {
int ltype; int ltype;
BOOL setlvl; BOOL setlvl;
} PortalStruct; } PortalStruct;
#pragma pack(pop)
////////////////////////////////////////////////// //////////////////////////////////////////////////
// msg // msg
@ -972,7 +968,6 @@ typedef struct TBuffer {
// quests // quests
////////////////////////////////////////////////// //////////////////////////////////////////////////
#pragma pack(push, 4)
typedef struct QuestStruct { typedef struct QuestStruct {
unsigned char _qlevel; unsigned char _qlevel;
unsigned char _qtype; unsigned char _qtype;
@ -987,7 +982,6 @@ typedef struct QuestStruct {
unsigned char _qvar2; unsigned char _qvar2;
int _qlog; int _qlog;
} QuestStruct; } QuestStruct;
#pragma pack(pop)
typedef struct QuestData { typedef struct QuestData {
unsigned char _qdlvl; unsigned char _qdlvl;

Loading…
Cancel
Save