re-introduce the thing == tmthing->target check, so it applies to non-players

This commit is contained in:
Arthur 2024-02-16 12:27:25 -05:00
parent 5e29cd84a2
commit dc625496d8

View file

@ -1279,7 +1279,8 @@ static unsigned PIT_DoCheckThing(mobj_t *thing)
if (tmthing->type != MT_SHELL && tmthing->target && tmthing->target->type == thing->type) if (tmthing->type != MT_SHELL && tmthing->target && tmthing->target->type == thing->type)
{ {
// Don't hit yourself, and if a player, don't hit bots // Don't hit yourself, and if a player, don't hit bots
if (thing->player && tmthing->target->player && !P_CanPlayerHurtPlayer(thing->player, tmthing, tmthing->target->player, 0)) if (thing == tmthing->target
|| (thing->player && tmthing->target->player && !P_CanPlayerHurtPlayer(thing->player, tmthing, tmthing->target->player, 0)))
return CHECKTHING_IGNORE; return CHECKTHING_IGNORE;
if (thing->type != MT_PLAYER) if (thing->type != MT_PLAYER)