mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-26 05:51:20 +00:00
Added some null pointer checks to prevent crashes.
This commit is contained in:
parent
44623daafe
commit
520b6af947
2 changed files with 4 additions and 1 deletions
|
@ -1614,6 +1614,9 @@ DEFINE_ACTION_FUNCTION(AActor, PoisonMobj)
|
|||
|
||||
bool AActor::OkayToSwitchTarget(AActor *other)
|
||||
{
|
||||
if (other == nullptr)
|
||||
return false;
|
||||
|
||||
if (other == this)
|
||||
return false; // [RH] Don't hate self (can happen when shooting barrels)
|
||||
|
||||
|
|
|
@ -1686,7 +1686,7 @@ FPathTraverse::~FPathTraverse()
|
|||
//
|
||||
int P_CheckFov(AActor* t1, AActor* t2, double fov)
|
||||
{
|
||||
return absangle(t1->AngleTo(t2), t1->Angles.Yaw) <= DAngle::fromDeg(fov);
|
||||
return absangle(t1->AngleTo(PARAM_NULLCHECK(t2,t2)), t1->Angles.Yaw) <= DAngle::fromDeg(fov);
|
||||
}
|
||||
|
||||
DEFINE_ACTION_FUNCTION_NATIVE(AActor, CheckFov, P_CheckFov)
|
||||
|
|
Loading…
Reference in a new issue