mirror of
https://github.com/ZDoom/Raze.git
synced 2025-03-13 20:42:11 +00:00
- Duke: added some null pointer checks.
This commit is contained in:
parent
42e4e9288f
commit
5d09748af9
4 changed files with 8 additions and 7 deletions
|
@ -245,10 +245,9 @@ void insertspriteq(DDukeActor* const actor)
|
|||
{
|
||||
if (spriteq[spriteqloc] != nullptr)
|
||||
{
|
||||
// Why is this not deleted here?
|
||||
// Also todo: Make list size a CVAR.
|
||||
// todo: Make list size a CVAR.
|
||||
spriteq[spriteqloc]->s->xrepeat = 0;
|
||||
// deletesprite(spriteq[spriteqloc]);
|
||||
deletesprite(spriteq[spriteqloc]);
|
||||
}
|
||||
spriteq[spriteqloc] = actor;
|
||||
spriteqloc = (spriteqloc + 1) % spriteqamount;
|
||||
|
@ -779,7 +778,8 @@ void movecrane(DDukeActor *actor, int crane)
|
|||
else if (t[0] == 9)
|
||||
t[0] = 0;
|
||||
|
||||
SetActor(cpt.poleactor, { spri->x, spri->y, spri->z - (34 << 8) });
|
||||
if (cpt.poleactor)
|
||||
SetActor(cpt.poleactor, { spri->x, spri->y, spri->z - (34 << 8) });
|
||||
|
||||
auto Owner = actor->GetOwner();
|
||||
if (Owner != nullptr || actor->IsActiveCrane())
|
||||
|
|
|
@ -248,14 +248,14 @@ void animatesprites_d(tspritetype* tsprite, int& spritesortcnt, int x, int y, in
|
|||
continue;
|
||||
case VIEWSCREEN:
|
||||
case VIEWSCREEN2:
|
||||
if (camsprite != nullptr && h->GetHitOwner()->temp_data[0] == 1)
|
||||
if (camsprite != nullptr && h->GetHitOwner() && h->GetHitOwner()->temp_data[0] == 1)
|
||||
{
|
||||
t->picnum = STATIC;
|
||||
t->cstat |= (rand() & 12);
|
||||
t->xrepeat += 8;
|
||||
t->yrepeat += 8;
|
||||
}
|
||||
else if (camsprite == h->GetHitOwner())
|
||||
else if (camsprite && camsprite == h->GetHitOwner())
|
||||
{
|
||||
t->picnum = TILE_VIEWSCR;
|
||||
}
|
||||
|
|
|
@ -113,7 +113,7 @@ public:
|
|||
{
|
||||
UnloadSound(schan->SoundID);
|
||||
currentCommentarySound = 0;
|
||||
currentCommentarySprite->s->picnum = DEVELOPERCOMMENTARY;
|
||||
if (currentCommentarySprite) currentCommentarySprite->s->picnum = DEVELOPERCOMMENTARY;
|
||||
I_SetRelativeVolume(1.0f);
|
||||
UnmuteSounds();
|
||||
}
|
||||
|
|
|
@ -500,6 +500,7 @@ void initcrane(DDukeActor* actj, DDukeActor* acti, int CRANEPOLE)
|
|||
apt.x = sp->x;
|
||||
apt.y = sp->y;
|
||||
apt.z = sp->z;
|
||||
apt.poleactor = nullptr;
|
||||
|
||||
DukeStatIterator it(STAT_DEFAULT);
|
||||
while (auto act = it.Next())
|
||||
|
|
Loading…
Reference in a new issue