diff --git a/docs/reference.xml b/docs/reference.xml
index 51dba1e0..1151fcf7 100644
--- a/docs/reference.xml
+++ b/docs/reference.xml
@@ -1995,8 +1995,60 @@ Output:
Returns the remaining minutes of the currently played game. READ ONLY
+
+
+
+
+
+
+
+ Returns the time (in milliseconds) of the currently played game. READ ONLY
+
+
+ $lastgametimeupdate 0) [
+ gmr = (- $gametimemaximum (+ $gametimecurrent (- (millis) $lastgametimeupdate)))
+ gsr = (div $gmr 1000)
+ gts = (mod $gsr 60)
+ if (< $gts 10) [ gts = (concatword 0 $gts) ] [ ]
+ gtm = (div $gsr 60)
+ if (< $gtm 10) [ gtm = (concatword 0 $gtm) ] [ ]
+ echo (concatword $gtm : $gts) remaining
+ ] [
+ echo gametime not updated yet
+ ]
+]]]>
+
+
+
+
+
+
+
+
+
+
+
+ Returns the maximum time (in milliseconds) of the currently played game. READ ONLY
+
+
+
+
+
+
+
+
+
+ Returns the last time (in milliseconds) the gametime was updated. READ ONLY
+
+
+
+
+
+
+
Determines if the game should be paused.
diff --git a/source/src/clientgame.cpp b/source/src/clientgame.cpp
index 4cd3b779..f21bb736 100644
--- a/source/src/clientgame.cpp
+++ b/source/src/clientgame.cpp
@@ -778,7 +778,8 @@ COMMAND(pstat_weap, ARG_1INT);
VAR(minutesremaining, 1, 0, 0);
VAR(gametimecurrent, 1, 0, 0);
VAR(gametimemaximum, 1, 0, 0);
-int lastgametimeupdate = 0;
+VAR(lastgametimeupdate, 1, 0, 0);
+
void timeupdate(int milliscur, int millismax)
{
lastgametimeupdate = lastmillis;
@@ -939,6 +940,7 @@ void startmap(const char *name, bool reset) // called just after a map load
intermission = false;
showscores(false);
minutesremaining = -1;
+ lastgametimeupdate = 0;
arenaintermission = 0;
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" : "");