From 1696e0dd9675f087608fdfabb7b5c93d7d2820df Mon Sep 17 00:00:00 2001 From: Marisa-Chan Date: Mon, 4 Aug 2014 16:43:15 +0700 Subject: ZVISION: Prepare save data while changing location --- engines/zvision/scripting/script_manager.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'engines/zvision') diff --git a/engines/zvision/scripting/script_manager.cpp b/engines/zvision/scripting/script_manager.cpp index 380141490a..7a2854d230 100644 --- a/engines/zvision/scripting/script_manager.cpp +++ b/engines/zvision/scripting/script_manager.cpp @@ -538,8 +538,18 @@ void ScriptManager::do_changeLocation() { } } - // Auto save - //_engine->getSaveManager()->autoSave(); + if (_nextLocation.world == 'g' && _nextLocation.room == 'j') { + if (_nextLocation.node == 's' && _nextLocation.view == 'e' && + _currentLocation.world != 'g' && _currentLocation.room != 'j') + _engine->getSaveManager()->prepareSaveBuffer(); + } else { + if (_currentLocation.world == 'g' && _currentLocation.room == 'j') + _engine->getSaveManager()->flushSaveBuffer(); + else { + // Auto save + //_engine->getSaveManager()->autoSave(); + } + } setStateValue(StateKey_World, _nextLocation.world); setStateValue(StateKey_Room, _nextLocation.room); -- cgit v1.2.3