aboutsummaryrefslogtreecommitdiff
path: root/sword1
diff options
context:
space:
mode:
authorRobert Göffringmann2004-03-07 19:14:32 +0000
committerRobert Göffringmann2004-03-07 19:14:32 +0000
commit757bc4cec6f9dc053c43a4cb3527342b1d74c78f (patch)
tree6739031d8ffbc0132de206313b7b5c72a322a0ed /sword1
parentec5f7b87c6097cf600d5e38acaa893337a88baca (diff)
downloadscummvm-rg350-757bc4cec6f9dc053c43a4cb3527342b1d74c78f.tar.gz
scummvm-rg350-757bc4cec6f9dc053c43a4cb3527342b1d74c78f.tar.bz2
scummvm-rg350-757bc4cec6f9dc053c43a4cb3527342b1d74c78f.zip
work around script bug #911508 BS1: Crash when loading certain savegames
svn-id: r13215
Diffstat (limited to 'sword1')
-rw-r--r--sword1/logic.cpp10
-rw-r--r--sword1/sworddefs.h2
2 files changed, 12 insertions, 0 deletions
diff --git a/sword1/logic.cpp b/sword1/logic.cpp
index 84ede12c4e..fd99c8eb15 100644
--- a/sword1/logic.cpp
+++ b/sword1/logic.cpp
@@ -81,6 +81,16 @@ void Logic::newScreen(uint32 screen) {
Object *compact = (Object*)_objMan->fetchObject(PLAYER);
if (SwordEngine::_systemVars.justRestoredGame) { // if we've just restored a game - we want George to be exactly as saved
+ // work around script bug #911508
+ if ((_scriptVars[SCREEN] == 25) && (_scriptVars[SAND_FLAG] == 4)) {
+ Object *cpt = _objMan->fetchObject(SAND_25);
+ Object *george = _objMan->fetchObject(PLAYER);
+ if (george->o_place == HOLDING_REPLICA_25) // is george holding the replica in his hands?
+ fnFullSetFrame(cpt, SAND_25, IMPFLRCDT, IMPFLR, 0, 0, 0, 0); // empty impression in floor
+ else
+ fnFullSetFrame(cpt, SAND_25, IMPPLSCDT, IMPPLS, 0, 0, 0, 0); // impression filled with plaster
+ }
+
fnAddHuman(NULL, 0, 0, 0, 0, 0, 0, 0);
if (_scriptVars[GEORGE_WALKING]) { // except that if George was walking when we saveed the game
fnStandAt(compact, PLAYER, _scriptVars[CHANGE_X], _scriptVars[CHANGE_Y], _scriptVars[CHANGE_DIR], _scriptVars[CHANGE_STANCE], 0,0);
diff --git a/sword1/sworddefs.h b/sword1/sworddefs.h
index 7a2074511e..1e89068135 100644
--- a/sword1/sworddefs.h
+++ b/sword1/sworddefs.h
@@ -1534,6 +1534,8 @@ enum ScriptVariableNames {
POCKET_52
};
+#define SAND_25 1638407
+#define HOLDING_REPLICA_25 1638408
#define GMASTER_79 5177345
#define SCR_std_off (0*0x10000 + 6)
#define SCR_exit0 (0*0x10000 + 7)