From 921a7a7166c5b2bac2128314baa983dabf041c83 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sun, 22 Nov 2020 18:46:20 +0100 Subject: [PATCH] - RRRA: fixed progression from E1L7 to E2L1 plus a texture related crash. Fixes #189. --- source/core/mapinfo.cpp | 2 +- source/games/duke/src/animatesprites_r.cpp | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/source/core/mapinfo.cpp b/source/core/mapinfo.cpp index 25cce2d53..506cae54c 100644 --- a/source/core/mapinfo.cpp +++ b/source/core/mapinfo.cpp @@ -98,7 +98,7 @@ MapRecord *FindMapByLevelNum(int num) MapRecord *FindNextMap(MapRecord *thismap) { - if (thismap->nextLevel != -1) return &mapList[thismap->nextLevel]; + if (thismap->nextLevel != -1) return FindMapByLevelNum(thismap->nextLevel); return FindMapByLevelNum(thismap->levelNumber+1); } diff --git a/source/games/duke/src/animatesprites_r.cpp b/source/games/duke/src/animatesprites_r.cpp index ab403510f..7758084db 100644 --- a/source/games/duke/src/animatesprites_r.cpp +++ b/source/games/duke/src/animatesprites_r.cpp @@ -707,8 +707,13 @@ void animatesprites_r(int x, int y, int a, int smoothratio) t->picnum += k + ScriptCode[t4] + l * t3; if (l > 0) - while (!tileGetTexture(t->picnum)->isValid() && t->picnum > 0) + while (t->picnum >= 0 && t->picnum < MAXTILES && !tileGetTexture(t->picnum)->isValid() && t->picnum > 0) t->picnum -= l; //Hack, for actors + if (t->picnum < 0 || t->picnum >= MAXTILES) + { + t->picnum = 0; + t->xrepeat = t->yrepeat = 0; + } if (h->dispicnum >= 0) h->dispicnum = t->picnum;