- Blood: Replace a few missed numerical constants with enums.

This commit is contained in:
Mitchell Richters 2021-08-18 19:57:31 +10:00
parent 77704d54d9
commit 84496029a9

View file

@ -171,7 +171,7 @@ static bool sub_4B1A4(PLAYER *pPlayer)
static bool BannedUnderwater(int nWeapon) static bool BannedUnderwater(int nWeapon)
{ {
return nWeapon == 7 || nWeapon == 6; return nWeapon == kWeapSpraycan || nWeapon == kWeapDynamite;
} }
static bool CheckWeaponAmmo(PLAYER *pPlayer, int weapon, int ammotype, int count) static bool CheckWeaponAmmo(PLAYER *pPlayer, int weapon, int ammotype, int count)
@ -180,9 +180,9 @@ static bool CheckWeaponAmmo(PLAYER *pPlayer, int weapon, int ammotype, int count
return 1; return 1;
if (ammotype == -1) if (ammotype == -1)
return 1; return 1;
if (weapon == 12 && pPlayer->weaponAmmo == 11 && pPlayer->weaponState == 11) if (weapon == kWeapRemote && pPlayer->weaponAmmo == 11 && pPlayer->weaponState == 11)
return 1; return 1;
if (weapon == 9 && pPlayer->pXSprite->health > 0) if (weapon == kWeapLifeLeech && pPlayer->pXSprite->health > 0)
return 1; return 1;
return pPlayer->ammoCount[ammotype] >= count; return pPlayer->ammoCount[ammotype] >= count;
} }
@ -523,7 +523,7 @@ void WeaponRaise(PLAYER *pPlayer)
if (gInfiniteAmmo || checkAmmo2(pPlayer, 5, 1)) if (gInfiniteAmmo || checkAmmo2(pPlayer, 5, 1))
{ {
pPlayer->weaponState = 3; pPlayer->weaponState = 3;
if (prevWeapon == 7) if (prevWeapon == kWeapSpraycan)
StartQAV(pPlayer, kQAVBUNUP); StartQAV(pPlayer, kQAVBUNUP);
else else
StartQAV(pPlayer, kQAVBUNUP2); StartQAV(pPlayer, kQAVBUNUP2);
@ -2100,7 +2100,7 @@ void WeaponProcess(PLAYER *pPlayer) {
} }
if (pPlayer->input.getNewWeapon() == WeaponSel_Next) if (pPlayer->input.getNewWeapon() == WeaponSel_Next)
{ {
pPlayer->input.setNewWeapon(0); pPlayer->input.setNewWeapon(kWeapNone);
if (VanillaMode()) if (VanillaMode())
{ {
pPlayer->weaponState = 0; pPlayer->weaponState = 0;
@ -2122,7 +2122,7 @@ void WeaponProcess(PLAYER *pPlayer) {
} }
else if (pPlayer->input.getNewWeapon() == WeaponSel_Prev) else if (pPlayer->input.getNewWeapon() == WeaponSel_Prev)
{ {
pPlayer->input.setNewWeapon(0); pPlayer->input.setNewWeapon(kWeapNone);
if (VanillaMode()) if (VanillaMode())
{ {
pPlayer->weaponState = 0; pPlayer->weaponState = 0;
@ -2161,7 +2161,7 @@ void WeaponProcess(PLAYER *pPlayer) {
return; return;
} }
pPlayer->input.setNewWeapon(0); pPlayer->input.setNewWeapon(kWeapNone);
pPlayer->weaponState = 0; pPlayer->weaponState = 0;
pPlayer->nextWeapon = kWeapNone; pPlayer->nextWeapon = kWeapNone;
int t = 0; int t = 0;