mirror of
https://github.com/ZDoom/Raze.git
synced 2025-03-30 20:51:02 +00:00
- Exhumed: Move Player::nCurrentItem
usage into the right spot.
* Originally, `updatePlayerInventory()` was in the main loop and not the player ticker. Now that it's been relocated, this makes sense.
This commit is contained in:
parent
d66f97e5dc
commit
99e23a8d24
2 changed files with 1 additions and 9 deletions
|
@ -303,7 +303,6 @@ void RestartPlayer(int nPlayer)
|
|||
pPlayer->nBreathTimer = 90;
|
||||
pPlayer->nTauntTimer = RandomSize(3) + 3;
|
||||
pPlayer->ototalvel = pPlayer->totalvel = 0;
|
||||
pPlayer->nCurrentItem = -1;
|
||||
pPlayer->nDeathType = 0;
|
||||
pPlayer->nQuake = 0;
|
||||
pPlayer->nTemperature = 0;
|
||||
|
@ -1185,7 +1184,7 @@ static void updatePlayerInventory(Player* const pPlayer)
|
|||
|
||||
if (pPlayer->items[i] > 0 && nItemMagic[i] <= pPlayer->nMagic)
|
||||
{
|
||||
pPlayer->nCurrentItem = i;
|
||||
UseItem(pPlayer->nPlayer, i);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -1251,12 +1250,6 @@ static void doPlayerCounters(Player* const pPlayer)
|
|||
const auto pPlayerActor = pPlayer->pActor;
|
||||
const bool bConsolePlayer = pPlayer->nPlayer == nLocalPlayer;
|
||||
|
||||
if (pPlayer->nCurrentItem > -1)
|
||||
{
|
||||
UseItem(pPlayer->nPlayer, pPlayer->nCurrentItem);
|
||||
pPlayer->nCurrentItem = -1;
|
||||
}
|
||||
|
||||
if (pPlayer->nTorch > 0)
|
||||
{
|
||||
pPlayer->nTorch--;
|
||||
|
|
|
@ -65,7 +65,6 @@ struct Player
|
|||
uint16_t keys;
|
||||
int16_t nMagic;
|
||||
int16_t nItem;
|
||||
int8_t nCurrentItem;
|
||||
int8_t items[8];
|
||||
int16_t nAmmo[7]; // TODO - kMaxWeapons?
|
||||
|
||||
|
|
Loading…
Reference in a new issue