- RRRA: fixed progression from E1L7 to E2L1 plus a texture related crash.

Fixes #189.
This commit is contained in:
Christoph Oelckers 2020-11-22 18:46:20 +01:00
parent 24c797b7e3
commit 921a7a7166
2 changed files with 7 additions and 2 deletions

View file

@ -98,7 +98,7 @@ MapRecord *FindMapByLevelNum(int num)
MapRecord *FindNextMap(MapRecord *thismap) 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); return FindMapByLevelNum(thismap->levelNumber+1);
} }

View file

@ -707,8 +707,13 @@ void animatesprites_r(int x, int y, int a, int smoothratio)
t->picnum += k + ScriptCode[t4] + l * t3; t->picnum += k + ScriptCode[t4] + l * t3;
if (l > 0) 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 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) if (h->dispicnum >= 0)
h->dispicnum = t->picnum; h->dispicnum = t->picnum;