diff --git a/devtools/create_neverhood/create_neverhood.cpp b/devtools/create_neverhood/create_neverhood.cpp index a1201cdaa350..fb2912f722a7 100644 --- a/devtools/create_neverhood/create_neverhood.cpp +++ b/devtools/create_neverhood/create_neverhood.cpp @@ -467,7 +467,15 @@ class StaticDataListVector { std::vector lists; void add(LISTCLASS *list) { - lists.push_back(list); + bool doAppend = true; + for (typename std::vector::iterator it = lists.begin(); it != lists.end(); it++) { + if ((*it)->id == list->id) { + doAppend = false; + break; + } + } + if (doAppend) + lists.push_back(list); } void loadListVector(const uint32 *offsets) { @@ -475,7 +483,6 @@ class StaticDataListVector { LISTCLASS *list = new LISTCLASS(); list->loadList(offsets[i], offsets[i + 1]); bool doAppend = true; - // Bad for (typename std::vector::iterator it = lists.begin(); it != lists.end(); it++) { if ((*it)->id == list->id) { doAppend = false; diff --git a/devtools/create_neverhood/tables.h b/devtools/create_neverhood/tables.h index cea962d4c149..edcecc5d8d28 100644 --- a/devtools/create_neverhood/tables.h +++ b/devtools/create_neverhood/tables.h @@ -45,7 +45,6 @@ static const uint32 rectListOffsets[] = { // Scene1002 3, 0x004B43A0, 1, 0x004B4418, - 3, 0x004B43A0, // Scene1004 1, 0x004B7C70, // Scene1109 diff --git a/dists/engine-data/neverhood.dat b/dists/engine-data/neverhood.dat index dc95c0096514..2f1bc4b52237 100644 Binary files a/dists/engine-data/neverhood.dat and b/dists/engine-data/neverhood.dat differ diff --git a/engines/fullpipe/modal.cpp b/engines/fullpipe/modal.cpp index 8981cdb8e63b..3dbbeb78c484 100644 --- a/engines/fullpipe/modal.cpp +++ b/engines/fullpipe/modal.cpp @@ -1456,6 +1456,9 @@ ModalSaveGame::ModalSaveGame() { _cancelL = 0; _emptyD = 0; _emptyL = 0; + _fullD = 0; + _fullL = 0; + _menuScene = 0; _queryRes = -1; _rect = g_fp->_sceneRect; _queryDlg = 0; diff --git a/engines/fullpipe/motion.cpp b/engines/fullpipe/motion.cpp index caac6d9e5ac7..adfc2f7326fe 100644 --- a/engines/fullpipe/motion.cpp +++ b/engines/fullpipe/motion.cpp @@ -554,8 +554,7 @@ MessageQueue *MctlLadder::doWalkTo(StaticANIObject *ani, int xpos, int ypos, int mq->transferExCommands(newmq); - if (newmq) - delete newmq; + delete newmq; ani->setPicAniInfo(&picinfo); @@ -1136,6 +1135,8 @@ MessageQueue *MovGraph::sub1(StaticANIObject *ani, int x, int y, int stid, int x _items[idx]->movarr._link = 0; res = fillMGMinfo(_items[idx]->ani, &_items[idx]->movarr, stid2); + + break; } } @@ -1517,6 +1518,8 @@ Common::Array *MovGraph::calcMovItems(MovArr *movarr1, MovArr *movarr genMovItem(r, tempObList2[i], movarr1, movarr2); + res->push_back(r); + delete tempObList2[i]; } diff --git a/engines/fullpipe/scenes.cpp b/engines/fullpipe/scenes.cpp index b346bf3a17cb..13c653ad094a 100644 --- a/engines/fullpipe/scenes.cpp +++ b/engines/fullpipe/scenes.cpp @@ -1455,6 +1455,9 @@ void BallChain::init(Ball **ball) { Ball *BallChain::sub04(Ball *ballP, Ball *ballN) { if (!pTail) { + if (!cPlexLen) + error("BallChain::sub04: cPlexLen is 0"); + cPlex = (byte *)calloc(cPlexLen, sizeof(Ball)); Ball *runPtr = (Ball *)&cPlex[(cPlexLen - 1) * sizeof(Ball)]; @@ -1463,7 +1466,7 @@ Ball *BallChain::sub04(Ball *ballP, Ball *ballN) { runPtr->p0 = pTail; pTail = runPtr; - runPtr -= sizeof(Ball); + runPtr--; } } diff --git a/engines/fullpipe/scenes/scene16.cpp b/engines/fullpipe/scenes/scene16.cpp index 9ed355fdd989..ed3c51a6c256 100644 --- a/engines/fullpipe/scenes/scene16.cpp +++ b/engines/fullpipe/scenes/scene16.cpp @@ -182,7 +182,7 @@ void sceneHandler16_fillMug() { mq = new MessageQueue(g_fp->_currentScene->getMessageQueueById(QU_SC16_BOYOUT), 0, 1); mq->replaceKeyCode(-1, g_vars->scene16_walkingBoy->_okeyCode); - if (mq->chain(g_vars->scene16_walkingBoy) || !mq) + if (!mq || mq->chain(g_vars->scene16_walkingBoy)) return; } else { if (!g_vars->scene16_walkingGirl) diff --git a/engines/fullpipe/statics.cpp b/engines/fullpipe/statics.cpp index 5d7de050f0f5..ec8514143eac 100644 --- a/engines/fullpipe/statics.cpp +++ b/engines/fullpipe/statics.cpp @@ -979,11 +979,12 @@ void StaticANIObject::stopAnim_maybe() { _ox += point.x; _oy += point.y; } + } else { + _statics = _movement->_staticsObj2; } - } - - if (_movement->_currDynamicPhaseIndex || !(_flags & 0x40)) + } else { _statics = _movement->_staticsObj2; + } _statics->getSomeXY(point);