client timeupdate() fix
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@5766 e016b1c5-ed68-44aa-a2f7-31cac88cffde
This commit is contained in:
@@ -798,9 +798,8 @@ void timeupdate(int milliscur, int millismax)
|
|||||||
lastgametimeupdate = lastmillis;
|
lastgametimeupdate = lastmillis;
|
||||||
gametimecurrent = milliscur;
|
gametimecurrent = milliscur;
|
||||||
gametimemaximum = millismax;
|
gametimemaximum = millismax;
|
||||||
int millisremaining = gametimemaximum - gametimecurrent;
|
minutesremaining = (gametimemaximum - gametimecurrent + 60000 - 1) / 60000;
|
||||||
minutesremaining = ceil((1.0f*millisremaining)/60000.0f);
|
if(!minutesremaining)
|
||||||
if(!millisremaining)
|
|
||||||
{
|
{
|
||||||
intermission = true;
|
intermission = true;
|
||||||
extern bool needsautoscreenshot;
|
extern bool needsautoscreenshot;
|
||||||
@@ -810,17 +809,17 @@ void timeupdate(int milliscur, int millismax)
|
|||||||
conoutf(_("game has ended!"));
|
conoutf(_("game has ended!"));
|
||||||
consolescores();
|
consolescores();
|
||||||
showscores(true);
|
showscores(true);
|
||||||
if(identexists("start_intermission")) execute("start_intermission");
|
if(identexists("start_intermission")) execute("start_intermission");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
extern int clockdisplay; // only output to console if no hud-clock is being shown
|
extern int clockdisplay; // only output to console if no hud-clock is being shown
|
||||||
if(clockdisplay==0) conoutf(_("time remaining: %d minutes"), minutesremaining);
|
if(minutesremaining==1)
|
||||||
if(millisremaining==60000)
|
|
||||||
{
|
{
|
||||||
audiomgr.musicsuggest(M_LASTMINUTE1 + rnd(2), 70*1000, true);
|
audiomgr.musicsuggest(M_LASTMINUTE1 + rnd(2), 70*1000, true);
|
||||||
hudoutf("1 minute left!");
|
hudoutf("1 minute left!");
|
||||||
}
|
}
|
||||||
|
else if(clockdisplay==0) conoutf(_("time remaining: %d minutes"), minutesremaining);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -953,7 +952,7 @@ void startmap(const char *name, bool reset) // called just after a map load
|
|||||||
intermission = false;
|
intermission = false;
|
||||||
showscores(false);
|
showscores(false);
|
||||||
minutesremaining = -1;
|
minutesremaining = -1;
|
||||||
lastgametimeupdate = 0;
|
lastgametimeupdate = 0;
|
||||||
arenaintermission = 0;
|
arenaintermission = 0;
|
||||||
bool noflags = (m_ctf || m_ktf) && (!numflagspawn[0] || !numflagspawn[1]);
|
bool noflags = (m_ctf || m_ktf) && (!numflagspawn[0] || !numflagspawn[1]);
|
||||||
if(*clientmap) conoutf(_("game mode is \"%s\"%s"), modestr(gamemode, modeacronyms > 0), noflags ? " - \f2but there are no flag bases on this map" : "");
|
if(*clientmap) conoutf(_("game mode is \"%s\"%s"), modestr(gamemode, modeacronyms > 0), noflags ? " - \f2but there are no flag bases on this map" : "");
|
||||||
|
|||||||
Reference in New Issue
Block a user