Added some null pointer checks to prevent crashes.

This commit is contained in:
inkoalawetrust 2023-08-31 19:38:14 +03:00 committed by Christoph Oelckers
commit 520b6af947
2 changed files with 4 additions and 1 deletions

View file

@ -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)