* Consistency in realtime.

* Actual indication of modified game status on the addons menu.
* Yes, I know this has nothing to do with the branch, I'm just doing little things I found useful.
This commit is contained in:
toaster 2018-06-06 15:13:09 +01:00
parent 5032ae2552
commit 33e0343cac
3 changed files with 26 additions and 21 deletions

View File

@ -4938,6 +4938,7 @@ static void M_DrawAddons(void)
{
INT32 x, y;
ssize_t i, max;
const char* topstr;
// hack - need to refresh at end of frame to handle addfile...
if (refreshdirmenu & M_AddonsRefresh())
@ -4949,9 +4950,16 @@ static void M_DrawAddons(void)
if (addonsresponselimit)
addonsresponselimit--;
V_DrawCenteredString(BASEVIDWIDTH/2, 4+offs, 0, (Playing()
? "\x85""Adding files mid-game may cause problems."
: LOCATIONSTRING));
if (Playing())
topstr = "\x85""Adding files mid-game may cause problems.";
else if (savemoddata)
topstr = "\x83""Add-on has its own data, saving enabled.";
else if (modifiedgame)
topstr = "\x87""Game is modified, saving is disabled.";
else
topstr = LOCATIONSTRING;
V_DrawCenteredString(BASEVIDWIDTH/2, 4+offs, 0, topstr);
if (numwadfiles <= mainwads+1)
y = 0;

View File

@ -9710,17 +9710,7 @@ void P_PlayerThink(player_t *player)
// Synchronizes the "real" amount of time spent in the level.
if (!player->exiting)
{
if (gametype == GT_RACE || gametype == GT_COMPETITION)
{
if (leveltime >= 4*TICRATE)
player->realtime = leveltime - 4*TICRATE;
else
player->realtime = 0;
}
else
player->realtime = leveltime;
}
player->realtime = leveltime;
if (player->spectator && cmd->buttons & BT_ATTACK && !player->powers[pw_flashing] && G_GametypeHasSpectators())
{

View File

@ -665,9 +665,9 @@ static void ST_drawTime(void)
else
{
// Counting down the hidetime?
if ((gametype == GT_TAG || gametype == GT_HIDEANDSEEK) && (leveltime <= (hidetime*TICRATE)))
if ((gametype == GT_TAG || gametype == GT_HIDEANDSEEK) && (stplyr->realtime <= (hidetime*TICRATE)))
{
tics = (hidetime*TICRATE - leveltime);
tics = (hidetime*TICRATE - stplyr->realtime);
if (tics < 3*TICRATE)
ST_drawRaceNum(tics);
downwards = true;
@ -675,15 +675,22 @@ static void ST_drawTime(void)
else
{
// Hidetime finish!
if ((gametype == GT_TAG || gametype == GT_HIDEANDSEEK) && (leveltime < ((hidetime+1)*TICRATE)))
ST_drawRaceNum(hidetime*TICRATE - leveltime);
if ((gametype == GT_TAG || gametype == GT_HIDEANDSEEK) && (stplyr->realtime < ((hidetime+1)*TICRATE)))
ST_drawRaceNum(hidetime*TICRATE - stplyr->realtime);
// Time limit?
if (gametype != GT_RACE && gametype != GT_COMPETITION && gametype != GT_COOP && cv_timelimit.value && timelimitintics > 0)
if (gametype == GT_RACE || gametype == GT_COMPETITION)
{
if (timelimitintics >= leveltime)
if (stplyr->realtime >= 4*TICRATE)
tics = stplyr->realtime - 4*TICRATE;
else
tics = 0;
}
else if (gametype != GT_COOP && cv_timelimit.value && timelimitintics > 0)
{
if (timelimitintics >= stplyr->realtime)
{
tics = (timelimitintics - leveltime);
tics = (timelimitintics - stplyr->realtime);
if (tics < 3*TICRATE)
ST_drawRaceNum(tics);
}