From 91fdf160b61ebbf5e38545284d3be6cc5ddbd76b Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Wed, 14 Oct 2020 17:04:09 +0200 Subject: [PATCH] - fixed clearing of actorinfo. It overwrote memory beyond its end. --- source/build/include/build.h | 14 -------------- source/games/duke/src/gamedef.cpp | 5 +---- 2 files changed, 1 insertion(+), 18 deletions(-) diff --git a/source/build/include/build.h b/source/build/include/build.h index 9f06f968f..0271ce2c7 100644 --- a/source/build/include/build.h +++ b/source/build/include/build.h @@ -1036,13 +1036,6 @@ public: next = nextspritestat[next]; return n; } - - spritetype *Next() - { - int n = next; - next = nextspritestat[next]; - return n < 0? nullptr : &sprite[n]; - } }; class SectIterator @@ -1067,13 +1060,6 @@ public: next = nextspritesect[next]; return n; } - - spritetype *Next() - { - int n = next; - next = nextspritestat[next]; - return n < 0? nullptr : &sprite[n]; - } }; #endif // build_h_ diff --git a/source/games/duke/src/gamedef.cpp b/source/games/duke/src/gamedef.cpp index 6320fc2e0..c40b2110b 100644 --- a/source/games/duke/src/gamedef.cpp +++ b/source/games/duke/src/gamedef.cpp @@ -3146,10 +3146,7 @@ void ConCompiler::setmusic() void loadcons() { - for (int i = 0; i < MAXTILES; i++) - { - memset(&actorinfo[i], 0, sizeof(actorinfo)); - } + memset(&actorinfo, 0, sizeof(actorinfo)); ScriptCode.Clear(); labels.Clear();