mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-27 22:42:57 +00:00
- fixed: air_finished was sometimes checked against level.time, sometimes against level.maptime.
For a per-level effect it needs to always check against level.maptime.
This commit is contained in:
parent
8a243cf084
commit
f5ad144934
4 changed files with 6 additions and 6 deletions
|
@ -1461,7 +1461,7 @@ class CommandDrawNumber : public CommandDrawString
|
|||
if(statusBar->CPlayer->mo->waterlevel < 3)
|
||||
num = primaryLevel->airsupply/TICRATE;
|
||||
else
|
||||
num = clamp<int>((statusBar->CPlayer->air_finished - primaryLevel->time + (TICRATE-1))/TICRATE, 0, INT_MAX);
|
||||
num = clamp<int>((statusBar->CPlayer->air_finished - primaryLevel->maptime + (TICRATE-1))/TICRATE, 0, INT_MAX);
|
||||
break;
|
||||
}
|
||||
case SELECTEDINVENTORY:
|
||||
|
@ -2751,7 +2751,7 @@ class CommandDrawBar : public SBarInfoCommand
|
|||
break;
|
||||
}
|
||||
case AIRTIME:
|
||||
value = clamp<int>(statusBar->CPlayer->air_finished - primaryLevel->time, 0, INT_MAX);
|
||||
value = clamp<int>(statusBar->CPlayer->air_finished - primaryLevel->maptime, 0, INT_MAX);
|
||||
max = primaryLevel->airsupply;
|
||||
break;
|
||||
case POWERUPTIME:
|
||||
|
|
|
@ -5419,7 +5419,7 @@ int DLevelScript::CallFunction(int argCount, int funcIndex, int32_t *args)
|
|||
}
|
||||
else
|
||||
{
|
||||
return Level->Players[args[0]]->air_finished - Level->time;
|
||||
return Level->Players[args[0]]->air_finished - Level->maptime;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -5431,7 +5431,7 @@ int DLevelScript::CallFunction(int argCount, int funcIndex, int32_t *args)
|
|||
}
|
||||
else
|
||||
{
|
||||
Level->Players[args[0]]->air_finished = args[1] + Level->time;
|
||||
Level->Players[args[0]]->air_finished = args[1] + Level->maptime;
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4330,7 +4330,7 @@ bool AActor::UpdateWaterLevel(bool dosplash)
|
|||
else if (oldlevel == 3 && waterlevel < 3)
|
||||
{
|
||||
// Our head just came up.
|
||||
if (player->air_finished > Level->time)
|
||||
if (player->air_finished > Level->maptime)
|
||||
{
|
||||
// We hadn't run out of air yet.
|
||||
S_Sound(this, CHAN_VOICE, "*surface", 1, ATTN_NORM);
|
||||
|
|
|
@ -599,7 +599,7 @@ class BaseStatusBar native ui
|
|||
if(CPlayer.mo.waterlevel < 3)
|
||||
return Level.airsupply;
|
||||
else
|
||||
return max(CPlayer.air_finished - Level.time, 0);
|
||||
return max(CPlayer.air_finished - Level.maptime, 0);
|
||||
}
|
||||
|
||||
int GetSelectedInventoryAmount()
|
||||
|
|
Loading…
Reference in a new issue