diff options
Diffstat (limited to 'engines/hdb')
-rw-r--r-- | engines/hdb/ai-init.cpp | 4 | ||||
-rw-r--r-- | engines/hdb/ai.h | 13 | ||||
-rw-r--r-- | engines/hdb/hdb.cpp | 2 |
3 files changed, 16 insertions, 3 deletions
diff --git a/engines/hdb/ai-init.cpp b/engines/hdb/ai-init.cpp index 7d9a15cde9..e2e42cc04c 100644 --- a/engines/hdb/ai-init.cpp +++ b/engines/hdb/ai-init.cpp @@ -1246,7 +1246,9 @@ void AI::restartSystem() { _hereList->clear(); // Clear Bridges - memset(&_bridges[0], 0, sizeof(_bridges)); + for (uint8 i = 0; i < ARRAYSIZE(_bridges); i++) { + _bridges[i].reset(); + } _numBridges = 0; // Clear waypoints diff --git a/engines/hdb/ai.h b/engines/hdb/ai.h index 86c3709aeb..37fc7efb3c 100644 --- a/engines/hdb/ai.h +++ b/engines/hdb/ai.h @@ -634,6 +634,7 @@ struct DlvEnt { destTextName[0] = 0; destGfxName[0] = 0; } + ~DlvEnt() { itemGfx = NULL; destGfx = NULL; @@ -765,7 +766,17 @@ struct Bridge { uint16 delay; uint16 anim; - Bridge() : x(0), y(0), dir(DIR_NONE), delay(0), anim(0) {} + void reset() { + x = 0; + y = 0; + dir = DIR_NONE; + delay = 0; + anim = 0; + } + + Bridge() { + reset(); + } }; struct CineCommand { diff --git a/engines/hdb/hdb.cpp b/engines/hdb/hdb.cpp index 14b7eb110e..8788c2037f 100644 --- a/engines/hdb/hdb.cpp +++ b/engines/hdb/hdb.cpp @@ -574,7 +574,7 @@ void HDBGame::useEntity(AIEntity *e) { AIEntity temp; if (_ai->getTableEnt(e->type)) { - memcpy(&temp, e, sizeof(AIEntity)); + temp = *e; _ai->getItemSound(e->type); |