PRINCE: canLoadGameStateCurrently() - to check if loading is allowed

Also block saving during dialogbox and inventory drawing
This commit is contained in:
lukaslw 2014-11-09 02:42:48 +01:00
parent d5938d2520
commit cb01dd36b6

View File

@ -177,7 +177,10 @@ bool PrinceEngine::canSaveGameStateCurrently() {
if (_mainHero->_visible) {
// 29 - Basement
if (_locationNr != 29) {
return true;
// No dialog box and not in inventory
if (!_dialogFlag && !_showInventoryFlag) {
return true;
}
}
}
}
@ -185,8 +188,18 @@ bool PrinceEngine::canSaveGameStateCurrently() {
}
bool PrinceEngine::canLoadGameStateCurrently() {
// Always true
return true;
if (_mouseFlag && _mouseFlag != 3) {
if (_mainHero->_visible) {
// 29 - Basement
if (_locationNr != 29) {
// No dialog box and not in inventory
if (!_dialogFlag && !_showInventoryFlag) {
return true;
}
}
}
}
return false;
}
Common::Error PrinceEngine::saveGameState(int slot, const Common::String &desc) {
@ -512,9 +525,6 @@ bool PrinceEngine::loadGame(int slotNumber) {
syncGame(readStream, nullptr);
delete readStream;
// TODO
//syncSpeechSettings();
return true;
}