- Duke/RR: Fixed sprite validation checks in animatesprites.

This commit is contained in:
Christoph Oelckers 2021-12-11 09:56:28 +01:00
parent 853aab5513
commit 507dc10e4f
2 changed files with 7 additions and 2 deletions

View file

@ -557,8 +557,10 @@ void animatesprites_d(spritetype* tsprite, int& spritesortcnt, int x, int y, int
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 -= l; //Hack, for actors
}
if (h->dispicnum >= 0)
h->dispicnum = t->picnum;

View file

@ -703,8 +703,11 @@ void animatesprites_r(spritetype* tsprite, int& spritesortcnt, int x, int y, int
t->picnum += k + ScriptCode[t4] + l * t3;
if (l > 0)
while (t->picnum >= 0 && t->picnum < MAXTILES && !tileGetTexture(t->picnum)->isValid() && t->picnum > 0)
{
while (t->picnum >= 0 && t->picnum < MAXTILES && !tileGetTexture(t->picnum)->isValid())
t->picnum -= l; //Hack, for actors
}
if (t->picnum < 0 || t->picnum >= MAXTILES)
{
t->picnum = 0;