- Port spritetype::insector() over from develop and use with sector nullptr checks in 6539d72663.

This commit is contained in:
Mitch Richters 2021-12-07 19:56:50 +11:00
parent 6539d72663
commit 63a19bbb15
5 changed files with 10 additions and 3 deletions

View file

@ -742,6 +742,12 @@ inline bool testgotpic(int32_t tilenume, bool reset = false)
}
inline bool spritetype::insector() const
{
return validSectorIndex(sectnum);
}
#include "iterators.h"
#endif // build_h_

View file

@ -376,6 +376,7 @@ struct spritetype
}
sectortype* sector() const;
bool insector() const;
};
using tspritetype = spritetype;

View file

@ -526,7 +526,7 @@ void moveplayers(void)
}
}
if (spri->sector())
if (spri->insector())
{
if (spri->sector()->ceilingstat & 1)
spri->shade += (spri->sector()->ceilingshade - spri->shade) >> 1;

View file

@ -2938,7 +2938,7 @@ void processinput_d(int snum)
p->angle.applyinput(sb_avel, &actions);
}
if (p->spritebridge == 0 && s->sector())
if (p->spritebridge == 0 && s->insector())
{
j = s->sector()->floorpicnum;

View file

@ -3651,7 +3651,7 @@ void processinput_r(int snum)
p->angle.applyinput(sb_avel, &actions);
}
if (p->spritebridge == 0 && s->sector())
if (p->spritebridge == 0 && s->insector())
{
int j = s->sector()->floorpicnum;
k = 0;