aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorFilippos Karapetis2019-08-14 20:31:04 +0300
committerFilippos Karapetis2019-08-15 11:58:16 +0300
commit089c04f6f7a13d40db1e5df5829e84c9a728371f (patch)
tree35447bdc2cb4b291ebfa8cc400419a18728749c6 /engines
parent384715da8448c303785072820329432461991deb (diff)
downloadscummvm-rg350-089c04f6f7a13d40db1e5df5829e84c9a728371f.tar.gz
scummvm-rg350-089c04f6f7a13d40db1e5df5829e84c9a728371f.tar.bz2
scummvm-rg350-089c04f6f7a13d40db1e5df5829e84c9a728371f.zip
STARTREK: Cleanup away mission chain loading code
Diffstat (limited to 'engines')
-rw-r--r--engines/startrek/room.cpp33
1 files changed, 19 insertions, 14 deletions
diff --git a/engines/startrek/room.cpp b/engines/startrek/room.cpp
index 79e6621b72..976d9f4b0a 100644
--- a/engines/startrek/room.cpp
+++ b/engines/startrek/room.cpp
@@ -586,20 +586,25 @@ void Room::endMission(int16 score, int16 arg1, int16 arg2) {
// TODO: This is a stopgap measure (loading the next away mission immediately).
// Replace this with the proper code later.
_vm->_gameMode = GAMEMODE_BEAMDOWN;
- if (_vm->_missionName == "DEMON")
- _vm->_missionToLoad = "TUG";
- if (_vm->_missionName == "TUG")
- _vm->_missionToLoad = "LOVE";
- if (_vm->_missionName == "LOVE")
- _vm->_missionToLoad = "MUDD";
- if (_vm->_missionName == "MUDD")
- _vm->_missionToLoad = "FEATHER";
- if (_vm->_missionName == "FEATHER")
- _vm->_missionToLoad = "TRIAL";
- if (_vm->_missionName == "TRIAL")
- _vm->_missionToLoad = "SINS";
- if (_vm->_missionName == "SINS")
- _vm->_missionToLoad = "VENG";
+
+ const char *missionNames[] = {
+ "DEMON",
+ "TUG",
+ "LOVE",
+ "MUDD",
+ "FEATHER",
+ "TRIAL",
+ "SINS",
+ "VENG"
+ };
+
+ for (int i = 0; i < ARRAYSIZE(missionNames); i++) {
+ if (_vm->_missionName == missionNames[i]) {
+ _vm->_missionToLoad = missionNames[i + 1];
+ break;
+ }
+ }
+
_vm->_roomIndexToLoad = 0;
}