diff options
Diffstat (limited to 'engines/cruise')
-rw-r--r-- | engines/cruise/linker.cpp | 8 | ||||
-rw-r--r-- | engines/cruise/menu.cpp | 3 | ||||
-rw-r--r-- | engines/cruise/object.cpp | 12 |
3 files changed, 8 insertions, 15 deletions
diff --git a/engines/cruise/linker.cpp b/engines/cruise/linker.cpp index 7768e05585..9786de775f 100644 --- a/engines/cruise/linker.cpp +++ b/engines/cruise/linker.cpp @@ -129,8 +129,6 @@ int updateScriptImport(int ovlIdx) { // do it for the 2 first string types do { - int i = 0; - if (param == 0) { var_32 = numData3; } else { @@ -138,16 +136,16 @@ int updateScriptImport(int ovlIdx) { } if (var_32) { + int i = 0; do { importScriptStruct *ptrImportData; const char *ptrImportName; uint8 *ptrData; - if (param == 0) { + if (param == 0) pScript = getOvlData3Entry(ovlIdx, i); - } else { + else pScript = scriptFunc1Sub2(ovlIdx, i); - } ptrImportData = (importScriptStruct *)(pScript->dataPtr + pScript->offsetToImportData); // import data ptrImportName = (const char*)(pScript->dataPtr + pScript->offsetToImportName); // import name diff --git a/engines/cruise/menu.cpp b/engines/cruise/menu.cpp index 8f162ee1ad..0a497202e2 100644 --- a/engines/cruise/menu.cpp +++ b/engines/cruise/menu.cpp @@ -233,7 +233,6 @@ static void handleSaveLoad(bool saveFlag) { } int playerMenu(int menuX, int menuY) { - int retourMenu; //int restartGame = 0; if (playerMenuEnabled && displayOn) { @@ -277,7 +276,7 @@ int playerMenu(int menuX, int menuY) { addSelectableMenuEntry(0, 6, menuTable[0], 1, -1, _vm->langString(ID_RESTART)); addSelectableMenuEntry(0, 7, menuTable[0], 1, -1, _vm->langString(ID_QUIT)); - retourMenu = processMenu(menuTable[0]); + int retourMenu = processMenu(menuTable[0]); freeMenu(menuTable[0]); menuTable[0] = NULL; diff --git a/engines/cruise/object.cpp b/engines/cruise/object.cpp index 3e61ff4d7d..664627b9a4 100644 --- a/engines/cruise/object.cpp +++ b/engines/cruise/object.cpp @@ -116,14 +116,10 @@ int16 getMultipleObjectParam(int16 overlayIdx, int16 objectIdx, objectParamsQuer } void setObjectPosition(int16 ovlIdx, int16 objIdx, int16 param3, int16 param4) { - objDataStruct *ptr; - objectParams *ptr2; - - ptr = getObjectDataFromOverlay(ovlIdx, objIdx); - - if (!ptr) { + objDataStruct *ptr = getObjectDataFromOverlay(ovlIdx, objIdx); + if (!ptr) return; - } + //overlayTable[param1].ovlData switch (ptr->_class) { @@ -138,7 +134,7 @@ void setObjectPosition(int16 ovlIdx, int16 objIdx, int16 param3, int16 param4) { case UNIQUE: return; case VARIABLE: { - ptr2 = &overlayTable[ovlIdx].ovlData->arrayObjVar[ptr->_varTableIdx]; + objectParams *ptr2 = &overlayTable[ovlIdx].ovlData->arrayObjVar[ptr->_varTableIdx]; switch (param3) { case 0: { // x |