- added NULL pointer checks to SpecialDropAction methods that call CheckLocalView.

This commit is contained in:
Christoph Oelckers 2016-05-15 09:16:37 +02:00
parent 6949afc334
commit aff8b00575

View file

@ -188,10 +188,13 @@ bool ARaiseAlarm::TryPickup (AActor *&toucher)
bool ARaiseAlarm::SpecialDropAction (AActor *dropper)
{
P_NoiseAlert (dropper->target, dropper->target);
if (dropper->target->CheckLocalView (consoleplayer))
if (dropper->target != nullptr)
{
Printf ("You Fool! You've set off the alarm.\n");
P_NoiseAlert(dropper->target, dropper->target);
if (dropper->target->CheckLocalView(consoleplayer))
{
Printf("You Fool! You've set off the alarm.\n");
}
}
Destroy ();
return true;
@ -237,11 +240,14 @@ bool ACloseDoor222::TryPickup (AActor *&toucher)
bool ACloseDoor222::SpecialDropAction (AActor *dropper)
{
EV_DoDoor (DDoor::doorClose, NULL, dropper, 222, 2., 0, 0, 0);
if (dropper->target->CheckLocalView (consoleplayer))
if (dropper->target != nullptr)
{
Printf ("You're dead! You set off the alarm.\n");
if (dropper->target->CheckLocalView(consoleplayer))
{
Printf("You're dead! You set off the alarm.\n");
}
P_NoiseAlert(dropper->target, dropper->target);
}
P_NoiseAlert (dropper->target, dropper->target);
Destroy ();
return true;
}