mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-20 00:41:12 +00:00
XEEN: Reset combat data when loading a new savegame
This commit is contained in:
parent
25eeee8e50
commit
569833b4ca
@ -2095,4 +2095,11 @@ bool Combat::areMonstersPresent() const {
|
||||
return false;
|
||||
}
|
||||
|
||||
void Combat::reset() {
|
||||
clearShooting();
|
||||
setupCombatParty();
|
||||
|
||||
_combatMode = COMBATMODE_STARTUP;
|
||||
}
|
||||
|
||||
} // End of namespace Xeen
|
||||
|
@ -204,6 +204,11 @@ public:
|
||||
*/
|
||||
void clearShooting();
|
||||
|
||||
/**
|
||||
* Resets all combat related data
|
||||
*/
|
||||
void reset();
|
||||
|
||||
/**
|
||||
* Gives damage to character or characters in the party
|
||||
*/
|
||||
|
@ -152,6 +152,7 @@ Common::Error SavesManager::saveGameState(int slot, const Common::String &desc)
|
||||
}
|
||||
|
||||
Common::Error SavesManager::loadGameState(int slot) {
|
||||
Combat &combat = *g_vm->_combat;
|
||||
EventsManager &events = *g_vm->_events;
|
||||
FileManager &files = *g_vm->_files;
|
||||
Map &map = *g_vm->_map;
|
||||
@ -187,6 +188,9 @@ Common::Error SavesManager::loadGameState(int slot) {
|
||||
// Read in miscellaneous
|
||||
files.load(*saveFile);
|
||||
|
||||
// Reset any combat information from the previous game
|
||||
combat.reset();
|
||||
|
||||
// Load the new map
|
||||
map.clearMaze();
|
||||
map._loadCcNum = files._ccNum;
|
||||
@ -206,6 +210,10 @@ void SavesManager::newGame() {
|
||||
File::_xeenSave = nullptr;
|
||||
File::_darkSave = nullptr;
|
||||
|
||||
// Reset any combat information from the previous game
|
||||
g_vm->_combat->reset();
|
||||
|
||||
// Reset the game states
|
||||
if (g_vm->getGameID() != GType_Clouds) {
|
||||
File::_darkSave = new SaveArchive(g_vm->_party);
|
||||
File::_darkSave->reset(File::_darkCc);
|
||||
|
Loading…
Reference in New Issue
Block a user