WAGE: Fix "New" and "Revert" option bugs#6436
Conversation
lephilousophe
left a comment
There was a problem hiding this comment.
I did not review the core of the changes, only the style.
Please follow our Commit Guidelines, especially on commit message formatting and linear history.
engines/wage/wage.cpp
Outdated
| } | ||
|
|
||
| //Resetting required variables | ||
| //TODO : Check if we should delete stuff like _monster,_offer before setting it back to null |
There was a problem hiding this comment.
I have just started to work on this engine and haven't fully understood the code base yet. I will fix this soon.
|
You need to follow our commit guidlines and code formatting guidelines. Please clean up, before we do a deeper review. |
438f337 to
447a42e
Compare
sev-
left a comment
There was a problem hiding this comment.
I added some questions. It is not clear to me if the changes you added were checked against other parts of the engine.
| for (uint32 i = 0; i < orderedScenes.size(); ++i) { | ||
| Scene *scene = orderedScenes[i]; | ||
| if (scene == _world->_storageScene) { | ||
| scene->_chrs.clear(); |
There was a problem hiding this comment.
Could you please explain the rationale behind this change?
There was a problem hiding this comment.
There was a bug when using the revert option: Take a object, save the game, then drop the object and then revert to the save. This caused the object to be both in the scene objects and the player inventory.
This is because the scene's characters and objects were not being cleared when we used the revert option. So I clear the objects and character of all scenes to ensure duplication is prevented.
engines/wage/gui.h
Outdated
| void disableUndo(); | ||
| void disableAllMenus(); | ||
| void enableAllMenus(); | ||
|
|
engines/wage/gui.cpp
Outdated
| _engine->_isGameOver = false; | ||
|
|
||
| _engine->loadGameState(_engine->_defaultSaveSlot); | ||
| _engine->_gui->enableAllMenus(); |
There was a problem hiding this comment.
Are you sure that all menus need to be enabled? What happens when the game starts at the very beginning?
There was a problem hiding this comment.
I think only some have to be enabled. I will correct it soon.
engines/wage/gui.cpp
Outdated
| _scene = nullptr; // To force current scene to be redrawn | ||
| _engine->redrawScene(); | ||
| g_system->updateScreen(); | ||
| g_system->delayMillis(100); |
engines/wage/wage.cpp
Outdated
| } | ||
|
|
||
| // Resetting required variables | ||
| void WageEngine::resetAllParameters() { |
There was a problem hiding this comment.
Maybe name it as resetState()? The term "parameters" is not used in this engine.
- Fix issue with "New" option after game over screen
Fix issue, where clicking the new option after the game over screen
causes the scene window to be not visible until scummvm is
restarted.
Fix by resetting game related variables in engine class
when the new option is clicked.
- Fix issue with "Revert" option
Fix issue, where using "Revert" when the previous save is in the
current scene, causes the current scene to not redraw. The objects
in the scene do not have correct ownership. They are both in the
scene objects and in player inventory.
Fix by forcing redraw and clearing scene objects and characters
during loading the previous save.
|
Thank you |
No description provided.