mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2025-01-31 04:20:34 +00:00
- fixed some more potential NULL pointer accesses.
SVN r3286 (trunk)
This commit is contained in:
parent
f2a457206c
commit
5747406776
2 changed files with 23 additions and 20 deletions
|
@ -266,9 +266,9 @@ DEFINE_ACTION_FUNCTION(AActor, A_FreezeDeathChunks)
|
||||||
self->x + (((pr_freeze()-128)*self->radius)>>7),
|
self->x + (((pr_freeze()-128)*self->radius)>>7),
|
||||||
self->y + (((pr_freeze()-128)*self->radius)>>7),
|
self->y + (((pr_freeze()-128)*self->radius)>>7),
|
||||||
self->z + (pr_freeze()*self->height/255), ALLOW_REPLACE);
|
self->z + (pr_freeze()*self->height/255), ALLOW_REPLACE);
|
||||||
mo->SetState (mo->SpawnState + (pr_freeze()%3));
|
|
||||||
if (mo)
|
if (mo)
|
||||||
{
|
{
|
||||||
|
mo->SetState (mo->SpawnState + (pr_freeze()%3));
|
||||||
mo->velz = FixedDiv(mo->z - self->z, self->height)<<2;
|
mo->velz = FixedDiv(mo->z - self->z, self->height)<<2;
|
||||||
mo->velx = pr_freeze.Random2 () << (FRACBITS-7);
|
mo->velx = pr_freeze.Random2 () << (FRACBITS-7);
|
||||||
mo->vely = pr_freeze.Random2 () << (FRACBITS-7);
|
mo->vely = pr_freeze.Random2 () << (FRACBITS-7);
|
||||||
|
@ -281,24 +281,27 @@ DEFINE_ACTION_FUNCTION(AActor, A_FreezeDeathChunks)
|
||||||
{ // attach the player's view to a chunk of ice
|
{ // attach the player's view to a chunk of ice
|
||||||
AActor *head = Spawn("IceChunkHead", self->x, self->y,
|
AActor *head = Spawn("IceChunkHead", self->x, self->y,
|
||||||
self->z + self->player->mo->ViewHeight, ALLOW_REPLACE);
|
self->z + self->player->mo->ViewHeight, ALLOW_REPLACE);
|
||||||
head->velz = FixedDiv(head->z - self->z, self->height)<<2;
|
if (head != NULL)
|
||||||
head->velx = pr_freeze.Random2 () << (FRACBITS-7);
|
|
||||||
head->vely = pr_freeze.Random2 () << (FRACBITS-7);
|
|
||||||
head->health = self->health;
|
|
||||||
head->angle = self->angle;
|
|
||||||
if (head->IsKindOf(RUNTIME_CLASS(APlayerPawn)))
|
|
||||||
{
|
{
|
||||||
head->player = self->player;
|
head->velz = FixedDiv(head->z - self->z, self->height)<<2;
|
||||||
head->player->mo = static_cast<APlayerPawn*>(head);
|
head->velx = pr_freeze.Random2 () << (FRACBITS-7);
|
||||||
self->player = NULL;
|
head->vely = pr_freeze.Random2 () << (FRACBITS-7);
|
||||||
head->ObtainInventory (self);
|
head->health = self->health;
|
||||||
}
|
head->angle = self->angle;
|
||||||
head->pitch = 0;
|
if (head->IsKindOf(RUNTIME_CLASS(APlayerPawn)))
|
||||||
head->RenderStyle = self->RenderStyle;
|
{
|
||||||
head->alpha = self->alpha;
|
head->player = self->player;
|
||||||
if (head->player->camera == self)
|
head->player->mo = static_cast<APlayerPawn*>(head);
|
||||||
{
|
self->player = NULL;
|
||||||
head->player->camera = head;
|
head->ObtainInventory (self);
|
||||||
|
}
|
||||||
|
head->pitch = 0;
|
||||||
|
head->RenderStyle = self->RenderStyle;
|
||||||
|
head->alpha = self->alpha;
|
||||||
|
if (head->player->camera == self)
|
||||||
|
{
|
||||||
|
head->player->camera = head;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -647,10 +647,10 @@ AInventory *AInventory::CreateTossable ()
|
||||||
{
|
{
|
||||||
copy->MaxAmount = MaxAmount;
|
copy->MaxAmount = MaxAmount;
|
||||||
copy->Amount = 1;
|
copy->Amount = 1;
|
||||||
|
copy->DropTime = 30;
|
||||||
|
copy->flags &= ~(MF_SPECIAL|MF_SOLID);
|
||||||
Amount--;
|
Amount--;
|
||||||
}
|
}
|
||||||
copy->DropTime = 30;
|
|
||||||
copy->flags &= ~(MF_SPECIAL|MF_SOLID);
|
|
||||||
return copy;
|
return copy;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue