diff options
Diffstat (limited to 'engines')
-rw-r--r-- | engines/kyra/animator_hof.cpp | 2 | ||||
-rw-r--r-- | engines/kyra/animator_v2.cpp | 2 | ||||
-rw-r--r-- | engines/kyra/items_v2.cpp | 4 |
3 files changed, 6 insertions, 2 deletions
diff --git a/engines/kyra/animator_hof.cpp b/engines/kyra/animator_hof.cpp index 76c66252ee..9314f8604e 100644 --- a/engines/kyra/animator_hof.cpp +++ b/engines/kyra/animator_hof.cpp @@ -37,8 +37,6 @@ void KyraEngine_HoF::restorePage3() { void KyraEngine_HoF::clearAnimObjects() { debugC(9, kDebugLevelAnimator, "KyraEngine_HoF::clearAnimObjects()"); - memset(_animObjects, 0, sizeof(AnimObj) * 41); - _animObjects[0].index = 0; _animObjects[0].type = 0; _animObjects[0].enabled = 1; diff --git a/engines/kyra/animator_v2.cpp b/engines/kyra/animator_v2.cpp index 10f7b02579..83081ca105 100644 --- a/engines/kyra/animator_v2.cpp +++ b/engines/kyra/animator_v2.cpp @@ -36,6 +36,8 @@ void KyraEngine_v2::allocAnimObjects(int actors, int anims, int items) { _animObjects = new AnimObj[actors+anims+items]; assert(_animObjects); + memset(_animObjects, 0, sizeof(AnimObj)*(actors+anims+items)); + _animActor = _animObjects; _animAnims = _animObjects + actors; _animItems = _animObjects + actors + anims; diff --git a/engines/kyra/items_v2.cpp b/engines/kyra/items_v2.cpp index c207a99963..78768c70ab 100644 --- a/engines/kyra/items_v2.cpp +++ b/engines/kyra/items_v2.cpp @@ -33,7 +33,11 @@ void KyraEngine_v2::initItemList(int size) { delete [] _itemList; _itemList = new Item[size]; + assert(_itemList); + memset(_itemList, 0, sizeof(Item)*size); _itemListSize = size; + + resetItemList(); } int KyraEngine_v2::findFreeItem() { |