diff options
author | tron <tron@openttd.org> | 2005-11-13 14:54:09 +0000 |
---|---|---|
committer | tron <tron@openttd.org> | 2005-11-13 14:54:09 +0000 |
commit | 4a14a586e2f457d38e9fede1a494478105a8acfd (patch) | |
tree | 0bcf189f35802c7769cd23e20ed58a18b59d9b2e /openttd.c | |
parent | ee15e3de13643b2d09abcc5424bf8e2d916cff75 (diff) | |
download | openttd-4a14a586e2f457d38e9fede1a494478105a8acfd.tar.xz |
(svn r3173) Use the trinary operator and switch to improve readability
Also align short cases nicely
Diffstat (limited to 'openttd.c')
-rw-r--r-- | openttd.c | 11 |
1 files changed, 5 insertions, 6 deletions
@@ -707,12 +707,11 @@ bool SafeSaveOrLoad(const char *filename, int mode, int newgm) _game_mode = newgm; r = SaveOrLoad(filename, mode); if (r == SL_REINIT) { - if (ogm == GM_MENU) - LoadIntroGame(); - else if (ogm == GM_EDITOR) - MakeNewEditorWorld(); - else - MakeNewGame(); + switch (ogm) { + case GM_MENU: LoadIntroGame(); break; + case GM_EDITOR: MakeNewEditorWorld(); break; + default: MakeNewGame(); break; + } return false; } else if (r != SL_OK) { _game_mode = ogm; |