aboutsummaryrefslogtreecommitdiff
path: root/sky/control.cpp
diff options
context:
space:
mode:
authorRobert Göffringmann2003-07-31 01:57:05 +0000
committerRobert Göffringmann2003-07-31 01:57:05 +0000
commit847c7025009c3fb394d5177dda453d97aca13295 (patch)
tree7c4a5b84108359fccf24cae47da7a3caa619713f /sky/control.cpp
parentf74197ce8b777422aabad0302292fc043b47e3d5 (diff)
downloadscummvm-rg350-847c7025009c3fb394d5177dda453d97aca13295.tar.gz
scummvm-rg350-847c7025009c3fb394d5177dda453d97aca13295.tar.bz2
scummvm-rg350-847c7025009c3fb394d5177dda453d97aca13295.zip
deactivated loading/(auto-)saving at places where it's not allowed
svn-id: r9315
Diffstat (limited to 'sky/control.cpp')
-rw-r--r--sky/control.cpp18
1 files changed, 16 insertions, 2 deletions
diff --git a/sky/control.cpp b/sky/control.cpp
index d6b29b3e84..b63057551f 100644
--- a/sky/control.cpp
+++ b/sky/control.cpp
@@ -506,13 +506,13 @@ uint16 SkyControl::handleClick(SkyConResource *pButton) {
return 0;
case REST_GAME_PANEL:
- if (SkyState::_systemVars.systemFlags & SF_CHOOSING)
+ if (!loadSaveAllowed())
return CANCEL_PRESSED; // can't save/restore while choosing
animClick(pButton);
return saveRestorePanel(false); // texts can't be edited
case SAVE_GAME_PANEL:
- if (SkyState::_systemVars.systemFlags & SF_CHOOSING)
+ if (!loadSaveAllowed())
return CANCEL_PRESSED; // can't save/restore while choosing
animClick(pButton);
return saveRestorePanel(true); // texts can be edited
@@ -1037,6 +1037,20 @@ void SkyControl::loadDescriptions(uint8 *destBuf) {
}
}
+bool SkyControl::loadSaveAllowed(void) {
+
+ if (SkyState::_systemVars.systemFlags & SF_CHOOSING)
+ return false; // texts get lost during load/save, so don't allow it during choosing
+ if (SkyLogic::_scriptVariables[SCREEN] >= 101)
+ return false; // same problem with LINC terminals
+ if ((SkyLogic::_scriptVariables[SCREEN] >= 82) &&
+ (SkyLogic::_scriptVariables[SCREEN] != 85) &&
+ (SkyLogic::_scriptVariables[SCREEN] < 90))
+ return false; // don't allow saving in final rooms
+
+ return true;
+}
+
void SkyControl::saveDescriptions(uint8 *srcBuf) {
uint8 *tmpBuf = (uint8 *)malloc(MAX_SAVE_GAMES * MAX_TEXT_LEN);