HOPKINS: Remove duplicate GOACTION variable.

This fixes arriving at destinations from the map view.
This commit is contained in:
Paul Gilbert 2012-10-28 15:46:52 +11:00
parent b005f9dad0
commit 367f0aac7e
4 changed files with 20 additions and 21 deletions

View File

@ -607,13 +607,6 @@ void DialogsManager::SAUVE_PARTIE() {
_vm->_objectsManager.SL_Y = 0;
if (slotNumber != 7) {
// Set the selected slot number
_vm->_globals.SAUVEGARDE->data[svField10] = slotNumber;
// Set up the inventory
for (int i = 0; i < 35; ++i)
_vm->_globals.SAUVEGARDE->inventory[i] = _vm->_globals.INVENTAIRE[i];
// Since the original GUI doesn't support save names, use a default name
saveName = Common::String::format("Save #%d", slotNumber);

View File

@ -56,7 +56,6 @@ ObjectsManager::ObjectsManager() {
DESACTIVE_CURSOR = 0;
BOBTOUS = false;
my_anim = 0;
GOACTION = 0;
NUMZONE = 0;
ARRET_PERSO_FLAG = 0;
ARRET_PERSO_NUM = 0;
@ -1890,7 +1889,7 @@ void ObjectsManager::GOHOME() {
} else {
SETANISPR(0, _vm->_globals.g_old_sens + 59);
_vm->_globals.ACTION_SENS = 0;
if (GOACTION == 1)
if (_vm->_globals.GOACTION == 1)
v54 = _vm->_globals.SAUVEGARDE->data[svField2];
else
v54 = NUMZONE;
@ -2231,7 +2230,7 @@ LABEL_153:
_vm->_globals.chemin++;
if (nouveau_x == -1 && v48 == -1) {
if (GOACTION == 1)
if (_vm->_globals.GOACTION == 1)
v49 = _vm->_globals.SAUVEGARDE->data[svField2];
else
v49 = NUMZONE;
@ -2804,7 +2803,7 @@ void ObjectsManager::BTGAUCHE() {
}
}
if (_vm->_globals.PLAN_FLAG == 1) {
if (GOACTION != 1)
if (_vm->_globals.GOACTION != 1)
goto LABEL_38;
VERIFZONE();
if (NUMZONE <= 0)
@ -2823,9 +2822,9 @@ void ObjectsManager::BTGAUCHE() {
v5[v2 + 2] = -1;
v5[v2 + 3] = -1;
}
if (GOACTION == 1) {
if (_vm->_globals.GOACTION == 1) {
VERIFZONE();
GOACTION = 0;
_vm->_globals.GOACTION = 0;
_vm->_globals.SAUVEGARDE->data[svField1] = 0;
_vm->_globals.SAUVEGARDE->data[svField2] = 0;
}
@ -2845,7 +2844,7 @@ LABEL_38:
}
}
}
GOACTION = 0;
_vm->_globals.GOACTION = 0;
v9 = _vm->_globals.chemin;
_vm->_globals.chemin = (int16 *)g_PTRNUL;
if (_vm->_globals.FORET && ((uint16)(NUMZONE - 20) <= 1u || (uint16)(NUMZONE - 22) <= 1u)) {
@ -2908,7 +2907,7 @@ LABEL_65:
_vm->_globals.SAUVEGARDE->data[svField1] = 6;
_vm->_globals.SAUVEGARDE->data[svField2] = NUMZONE;
_vm->_globals.SAUVEGARDE->data[svField3] = _vm->_globals.OBJET_EN_COURS;
GOACTION = 1;
_vm->_globals.GOACTION = 1;
}
_vm->_fontManager.TEXTE_OFF(5);
_vm->_graphicsManager.SETCOLOR4(251, 100, 100, 100);
@ -3036,7 +3035,7 @@ LABEL_64:
BTDROITE();
}
}
GOACTION = 0;
_vm->_globals.GOACTION = 0;
}
// Clear Screen
@ -3083,7 +3082,7 @@ void ObjectsManager::CLEAR_ECRAN() {
Vold_taille = 200;
_vm->_globals.SAUVEGARDE->data[svField1] = 0;
_vm->_globals.SAUVEGARDE->data[svField2] = 0;
GOACTION = 0;
_vm->_globals.GOACTION = 0;
FORCEZONE = 1;
CHANGEVERBE = 0;
_vm->_globals.NOSPRECRAN = 0;
@ -5637,7 +5636,7 @@ void ObjectsManager::PERSONAGE(const Common::String &s1, const Common::String &s
BTDROITE();
_vm->_dialogsManager.TestForDialogOpening();
VERIFZONE();
if (GOACTION == 1)
if (_vm->_globals.GOACTION == 1)
PARADISE();
if (!_vm->_globals.SORTIE) {
_vm->_eventsManager.VBL();
@ -5783,7 +5782,7 @@ LABEL_70:
VERIFZONE();
if (_vm->_globals.chemin == (int16 *)g_PTRNUL
|| (GOHOME(), _vm->_globals.chemin == (int16 *)g_PTRNUL)) {
if (GOACTION == 1)
if (_vm->_globals.GOACTION == 1)
PARADISE();
}
SPECIAL_JEU();

View File

@ -81,7 +81,6 @@ public:
int DESACTIVE_CURSOR;
bool BOBTOUS;
int my_anim;
int GOACTION;
int NUMZONE;
int ARRET_PERSO_FLAG;
int ARRET_PERSO_NUM;

View File

@ -138,7 +138,15 @@ void SaveLoadManager::writeSavegameHeader(Common::OutSaveFile *out, hopkinsSaveg
}
Common::Error SaveLoadManager::save(int slot, const Common::String &saveName) {
// Try and create the save file
/* Pack any necessary data into the savegame data structure */
// Set the selected slot number
_vm->_globals.SAUVEGARDE->data[svField10] = slot;
// Set up the inventory
for (int i = 0; i < 35; ++i)
_vm->_globals.SAUVEGARDE->inventory[i] = _vm->_globals.INVENTAIRE[i];
/* Create the savegame */
Common::OutSaveFile *saveFile = g_system->getSavefileManager()->openForSaving(
_vm->generateSaveName(slot));
if (!saveFile)