Skip to content

Commit

Permalink
BBVS: Move much of engine initialization to newGame()
Browse files Browse the repository at this point in the history
This should fix bug #7057 ("BBVS: No clean-up when restarting").
  • Loading branch information
Torbjörn Andersson committed Mar 14, 2016
1 parent 3f2469c commit ebad422
Showing 1 changed file with 17 additions and 16 deletions.
33 changes: 17 additions & 16 deletions engines/bbvs/bbvs.cpp
Expand Up @@ -137,6 +137,21 @@ BbvsEngine::~BbvsEngine() {
}

void BbvsEngine::newGame() {
memset(_easterEggInput, 0, sizeof(_easterEggInput));
_gameTicks = 0;
_playVideoNumber = 0;
memset(_inventoryItemStatus, 0, sizeof(_inventoryItemStatus));
memset(_gameVars, 0, sizeof(_gameVars));
memset(_sceneVisited, 0, sizeof(_sceneVisited));

_mouseX = 160;
_mouseY = 120;
_mouseButtons = 0;

_currVerbNum = kVerbLook;
_currTalkObjectIndex = -1;
_currSceneNum = 0;

_currInventoryItem = -1;
_newSceneNum = 32;
}
Expand All @@ -162,24 +177,10 @@ Common::Error BbvsEngine::run() {
_sound = new SoundMan();

allocSnapshot();
memset(_easterEggInput, 0, sizeof(_easterEggInput));

_gameTicks = 0;
_playVideoNumber = 0;
_bootSaveSlot = -1;

memset(_inventoryItemStatus, 0, sizeof(_inventoryItemStatus));
memset(_gameVars, 0, sizeof(_gameVars));
memset(_sceneVisited, 0, sizeof(_sceneVisited));

_mouseX = 160;
_mouseY = 120;
_mouseButtons = 0;
newGame();

_currVerbNum = kVerbLook;
_currInventoryItem = -1;
_currTalkObjectIndex = -1;
_currSceneNum = 0;
_bootSaveSlot = -1;
_newSceneNum = 31;

if (ConfMan.hasKey("save_slot"))
Expand Down

0 comments on commit ebad422

Please sign in to comment.