diff --git a/source/games/blood/src/common_game.h b/source/games/blood/src/common_game.h index a304c6baf..f2974bea4 100644 --- a/source/games/blood/src/common_game.h +++ b/source/games/blood/src/common_game.h @@ -483,6 +483,7 @@ enum kWeapProximity = 11, kWeapRemote = 12, kWeapBeast = 13, + kWeapMax = 14, }; // ------------------------------- diff --git a/source/games/blood/src/messages.cpp b/source/games/blood/src/messages.cpp index 525461b6b..5b9362e4e 100644 --- a/source/games/blood/src/messages.cpp +++ b/source/games/blood/src/messages.cpp @@ -106,7 +106,7 @@ void SetWeapons(bool stat) if (!VanillaMode()) { // Keep the pitchfork to avoid freeze - gMe->hasWeapon[1] = 1; + gMe->hasWeapon[kWeapPitchFork] = 1; gMe->curWeapon = kWeapNone; gMe->nextWeapon = kWeapPitchFork; } @@ -416,7 +416,7 @@ const char* GameInterface::GenericCheat(int player, int cheat) SetWooMode(true); powerupActivate(gMe, kPwUpDeliriumShroom); gMe->actor->xspr.health = 16; - gMe->hasWeapon[1] = 1; + gMe->hasWeapon[kWeapPitchFork] = 1; gMe->curWeapon = kWeapNone; gMe->nextWeapon = kWeapPitchFork; break; diff --git a/source/games/blood/src/nnexts.cpp b/source/games/blood/src/nnexts.cpp index c376d8af7..a5adfe3a6 100644 --- a/source/games/blood/src/nnexts.cpp +++ b/source/games/blood/src/nnexts.cpp @@ -2228,7 +2228,7 @@ void trPlayerCtrlEraseStuff(int value, PLAYER* pPlayer) if (i < 12) pPlayer->ammoCount[i] = 0; } - pPlayer->hasWeapon[1] = true; + pPlayer->hasWeapon[kWeapPitchFork] = true; pPlayer->curWeapon = kWeapNone; pPlayer->nextWeapon = kWeapPitchFork; diff --git a/source/games/blood/src/player.cpp b/source/games/blood/src/player.cpp index 17d434a8b..4e874c250 100644 --- a/source/games/blood/src/player.cpp +++ b/source/games/blood/src/player.cpp @@ -921,7 +921,7 @@ void playerReset(PLAYER* pPlayer) pPlayer->hasWeapon[i] = gInfiniteAmmo; pPlayer->weaponMode[i] = 0; } - pPlayer->hasWeapon[1] = 1; + pPlayer->hasWeapon[kWeapPitchFork] = 1; pPlayer->curWeapon = kWeapNone; pPlayer->qavCallback = -1; pPlayer->newWeapon = kWeapPitchFork; @@ -2516,7 +2516,7 @@ FSerializer& Serialize(FSerializer& arc, const char* keyname, PLAYER& w, PLAYER* ("weaponammo", w.weaponAmmo) .Array("hasweapon", w.hasWeapon, countof(w.hasWeapon)) .Array("weaponmode", w.weaponMode, countof(w.weaponMode)) - .Array("weaponorder", &w.weaponOrder[0][0], 14 * 2) + .Array("weaponorder", &w.weaponOrder[0][kWeapNone], +kWeapMax * 2) .Array("ammocount", w.ammoCount, countof(w.ammoCount)) ("qavloop", w.qavLoop) ("qavlastTick", w.qavLastTick) diff --git a/source/games/blood/src/player.h b/source/games/blood/src/player.h index 47eeeb550..4af6e31bc 100644 --- a/source/games/blood/src/player.h +++ b/source/games/blood/src/player.h @@ -118,9 +118,9 @@ struct PLAYER int weaponTimer; int weaponState; int weaponAmmo; //rename - bool hasWeapon[14]; - int weaponMode[14]; - int weaponOrder[2][14]; + bool hasWeapon[kWeapMax]; + int weaponMode[kWeapMax]; + int weaponOrder[2][kWeapMax]; //int at149[14]; int ammoCount[12]; bool qavLoop; diff --git a/source/games/blood/src/triggers.cpp b/source/games/blood/src/triggers.cpp index 56eb1f17c..041415e3e 100644 --- a/source/games/blood/src/triggers.cpp +++ b/source/games/blood/src/triggers.cpp @@ -239,13 +239,13 @@ void LifeLeechOperate(DBloodActor* actor, EVENT event) { evKillActor(actor); pPlayer->ammoCount[8] = ClipHigh(pPlayer->ammoCount[8] + actor->xspr.data3, gAmmoInfo[8].max); - pPlayer->hasWeapon[9] = 1; + pPlayer->hasWeapon[kWeapLifeLeech] = 1; if (pPlayer->curWeapon != kWeapLifeLeech) { if (!VanillaMode() && checkFired6or7(pPlayer)) // if tnt/spray is actively used, do not switch weapon break; pPlayer->weaponState = 0; - pPlayer->nextWeapon = 9; + pPlayer->nextWeapon = kWeapLifeLeech; } } } diff --git a/source/games/blood/src/weapon.cpp b/source/games/blood/src/weapon.cpp index 0d0e752d9..26f1f839b 100644 --- a/source/games/blood/src/weapon.cpp +++ b/source/games/blood/src/weapon.cpp @@ -1795,7 +1795,7 @@ void AltFireVoodoo(int nTrigger, PLAYER* pPlayer) } } UseAmmo(pPlayer, 9, pPlayer->ammoCount[9]); - pPlayer->hasWeapon[10] = 0; + pPlayer->hasWeapon[kWeapVoodooDoll] = 0; pPlayer->weaponState = -1; } } @@ -1816,7 +1816,7 @@ void DropVoodoo(int, PLAYER* pPlayer) evPostActor(spawned, 90, kCallbackDropVoodoo); UseAmmo(pPlayer, 6, gAmmoItemData[0].count); UseAmmo(pPlayer, 9, pPlayer->ammoCount[9]); - pPlayer->hasWeapon[10] = 0; + pPlayer->hasWeapon[kWeapVoodooDoll] = 0; } } @@ -2014,7 +2014,7 @@ void AltFireLifeLeech(int, PLAYER* pPlayer) missile->xspr.data3 = pPlayer->ammoCount[8]; pPlayer->ammoCount[8] = 0; } - pPlayer->hasWeapon[9] = 0; + pPlayer->hasWeapon[kWeapLifeLeech] = 0; } }