summaryrefslogtreecommitdiff
path: root/src/gamelog.cpp
diff options
context:
space:
mode:
authorglx <glx@openttd.org>2009-03-30 00:21:43 +0000
committerglx <glx@openttd.org>2009-03-30 00:21:43 +0000
commit75c99d8b9b7db2cc723e2bfb98ed8a81cc5e3f6f (patch)
treebe24c7a2e88a166f13ab937e7e836aa9f27254c7 /src/gamelog.cpp
parent8293be426cc8e4c6b228f906d00838d02f6edd0a (diff)
downloadopenttd-75c99d8b9b7db2cc723e2bfb98ed8a81cc5e3f6f.tar.xz
(svn r15893) -Add: watermark crash.sav and don't generate crash information if a loaded crash.sav causes a crash
Diffstat (limited to 'src/gamelog.cpp')
-rw-r--r--src/gamelog.cpp29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/gamelog.cpp b/src/gamelog.cpp
index 5fefb4a60..e47a19f0a 100644
--- a/src/gamelog.cpp
+++ b/src/gamelog.cpp
@@ -135,6 +135,7 @@ static const char *la_text[] = {
"cheat was used",
"settings changed",
"GRF bug triggered",
+ "emergency savegame",
};
assert_compile(lengthof(la_text) == GLAT_END);
@@ -249,6 +250,9 @@ void GamelogPrint(GamelogPrintProc *proc)
PrintGrfFilename(buf, lc->grfbug.grfid);
break;
}
+
+ case GLCT_EMERGENCY:
+ break;
}
proc(buf);
@@ -317,6 +321,31 @@ static LoggedChange *GamelogChange(GamelogChangeType ct)
}
+/** Logs a emergency savegame
+ */
+void GamelogEmergency()
+{
+ assert(_gamelog_action_type == GLAT_EMERGENCY);
+ GamelogChange(GLCT_EMERGENCY);
+}
+
+/** Finds out if current game is a loaded emergency savegame.
+ */
+bool GamelogTestEmergency()
+{
+ const LoggedChange *emergency = NULL;
+
+ const LoggedAction *laend = &_gamelog_action[_gamelog_actions];
+ for (const LoggedAction *la = _gamelog_action; la != laend; la++) {
+ const LoggedChange *lcend = &la->change[la->changes];
+ for (const LoggedChange *lc = la->change; lc != lcend; lc++) {
+ if (lc->ct == GLCT_EMERGENCY) emergency = lc;
+ }
+ }
+
+ return (emergency != NULL);
+}
+
/** Logs a change in game revision
* @param revision new revision string
*/