aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Stewart2018-07-26 00:30:23 -0400
committerEugene Sandulenko2018-08-09 08:37:30 +0200
commite3f00320ad76121430714f094dc8e9353eb04f2b (patch)
treebc645449b80ed38f4c87ccc7d11f424264395de3
parent919db23841c24475257182f6daddea59cefb408a (diff)
downloadscummvm-rg350-e3f00320ad76121430714f094dc8e9353eb04f2b.tar.gz
scummvm-rg350-e3f00320ad76121430714f094dc8e9353eb04f2b.tar.bz2
scummvm-rg350-e3f00320ad76121430714f094dc8e9353eb04f2b.zip
STARTREK: Fix elasi guard not shooting Kirk in TUG
-rw-r--r--engines/startrek/awaymission.h2
-rw-r--r--engines/startrek/room.h2
-rw-r--r--engines/startrek/rooms/tug2.cpp18
-rw-r--r--engines/startrek/saveload.cpp2
4 files changed, 13 insertions, 11 deletions
diff --git a/engines/startrek/awaymission.h b/engines/startrek/awaymission.h
index d912af78fa..0817946e9c 100644
--- a/engines/startrek/awaymission.h
+++ b/engines/startrek/awaymission.h
@@ -121,7 +121,7 @@ struct AwayMission {
bool savedPrisoners; // 0x48
bool haveBomb; // 0x49
bool brigElasiPhasersOnKill; // 0x4a
- byte field4b; // 0x4b
+ byte elasiTargetIndex; // 0x4b
byte guard1Status; // 0x4c
byte guard2Status; // 0x4d
byte field4e; // 0x4e
diff --git a/engines/startrek/room.h b/engines/startrek/room.h
index 6c623a6ce5..dad620e920 100644
--- a/engines/startrek/room.h
+++ b/engines/startrek/room.h
@@ -2210,7 +2210,7 @@ public:
byte shootingObject; // 0x1ec1
byte shootingTarget;
bool elasiPhaserOnKill;
- byte shootKirkOverride; // 0x1ec4
+ bool shootKirkOverride; // 0x1ec4
} tug;
struct {
diff --git a/engines/startrek/rooms/tug2.cpp b/engines/startrek/rooms/tug2.cpp
index a13abb81fb..2e8a9e61a2 100644
--- a/engines/startrek/rooms/tug2.cpp
+++ b/engines/startrek/rooms/tug2.cpp
@@ -624,9 +624,9 @@ void Room::tug2Timer0Expired() {
if (_vm->_awayMission.tug.brigElasiPhasersOnKill)
_roomVar.tug.elasiPhaserOnKill = 1;
- switch (_vm->_awayMission.tug.field4b) {
+ switch (_vm->_awayMission.tug.elasiTargetIndex) {
case 0:
- _vm->_awayMission.tug.field4b++;
+ _vm->_awayMission.tug.elasiTargetIndex++;
if (_vm->_awayMission.tug.guard2Status != GUARDSTAT_UP) {
// BUGFIX: reset the timer to allow guard 1 to continue if guard 2 is down
_vm->_awayMission.timers[0] = 60;
@@ -644,7 +644,7 @@ void Room::tug2Timer0Expired() {
case 1:
// Guard shoots redshirt
- _vm->_awayMission.tug.field4b++;
+ _vm->_awayMission.tug.elasiTargetIndex++;
if (!_vm->_awayMission.tug.crewmanKilled[OBJECT_REDSHIRT]) {
tug2DetermineElasiShooter();
_roomVar.tug.shootingTarget = OBJECT_REDSHIRT;
@@ -655,7 +655,7 @@ void Room::tug2Timer0Expired() {
case 2:
// Guard shoots spock (or kirk)
- _vm->_awayMission.tug.field4b++;
+ _vm->_awayMission.tug.elasiTargetIndex++;
_roomVar.tug.shootKirkOverride = false;
if (_vm->_awayMission.tug.brigElasiPhasersOnKill)
_roomVar.tug.shootKirkOverride = true;
@@ -669,7 +669,8 @@ void Room::tug2Timer0Expired() {
break;
case 3:
- _vm->_awayMission.tug.field4b++;
+ // Guard shoots Mccoy
+ _vm->_awayMission.tug.elasiTargetIndex++;
if (!_vm->_awayMission.tug.crewmanKilled[OBJECT_MCCOY]) {
tug2DetermineElasiShooter();
_roomVar.tug.shootingTarget = OBJECT_MCCOY;
@@ -679,16 +680,17 @@ void Room::tug2Timer0Expired() {
break;
case 4:
- _vm->_awayMission.tug.field4b++;
+ // Guard shoots kirk (or Spock)
+ _vm->_awayMission.tug.elasiTargetIndex++;
if (_roomVar.tug.shootKirkOverride) {
tug2DetermineElasiShooter();
_roomVar.tug.shootingTarget = OBJECT_SPOCK;
_vm->_awayMission.timers[2] = 40;
tug2GuardShootsCrewman();
- } else if (_roomVar.tug.shootKirkOverride) {
+ } else {
tug2DetermineElasiShooter();
_roomVar.tug.shootingTarget = OBJECT_KIRK;
- _vm->_awayMission.timers[2] = 40; // TODO
+ _vm->_awayMission.timers[2] = 40;
tug2GuardShootsCrewman();
}
break;
diff --git a/engines/startrek/saveload.cpp b/engines/startrek/saveload.cpp
index a290d14071..cac8a7830d 100644
--- a/engines/startrek/saveload.cpp
+++ b/engines/startrek/saveload.cpp
@@ -420,7 +420,7 @@ bool StarTrekEngine::saveOrLoadGameData(Common::SeekableReadStream *in, Common::
ser.syncAsByte(_awayMission.tug.savedPrisoners);
ser.syncAsByte(_awayMission.tug.haveBomb);
ser.syncAsByte(_awayMission.tug.brigElasiPhasersOnKill);
- ser.syncAsByte(_awayMission.tug.field4b);
+ ser.syncAsByte(_awayMission.tug.elasiTargetIndex);
ser.syncAsByte(_awayMission.tug.guard1Status);
ser.syncAsByte(_awayMission.tug.guard2Status);
ser.syncAsByte(_awayMission.tug.field4e);