mirror of
https://github.com/ZDoom/gzdoom.git
synced 2025-04-19 08:58:52 +00:00
Discs no longer blast players with collision disabled
This commit is contained in:
parent
3ea5be1ea7
commit
268dad18f7
3 changed files with 14 additions and 1 deletions
|
@ -121,13 +121,20 @@ TArray<spechit_t> portalhit;
|
|||
//
|
||||
//==========================================================================
|
||||
|
||||
bool P_ShouldPassThroughPlayer(AActor *self, AActor *other)
|
||||
static int P_ShouldPassThroughPlayer(AActor *self, AActor *other)
|
||||
{
|
||||
return (dmflags3 & DF3_NO_PLAYER_CLIP) &&
|
||||
other->player && other->player->mo == other &&
|
||||
self->IsFriend(other);
|
||||
}
|
||||
|
||||
DEFINE_ACTION_FUNCTION_NATIVE(AActor, ShouldPassThroughPlayer, P_ShouldPassThroughPlayer)
|
||||
{
|
||||
PARAM_SELF_PROLOGUE(AActor);
|
||||
PARAM_OBJECT_NOT_NULL(other, AActor);
|
||||
ACTION_RETURN_BOOL(P_ShouldPassThroughPlayer(self, other));
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
// CanCollideWith
|
||||
|
|
|
@ -844,6 +844,7 @@ class Actor : Thinker native
|
|||
native void Thrust(double speed = 1e37, double angle = 1e37);
|
||||
native clearscope bool isFriend(Actor other) const;
|
||||
native clearscope bool isHostile(Actor other) const;
|
||||
native clearscope bool ShouldPassThroughPlayer(Actor other) const;
|
||||
native void AdjustFloorClip();
|
||||
native clearscope DropItem GetDropItems() const;
|
||||
native void CopyFriendliness (Actor other, bool changeTarget, bool resetHealth = true);
|
||||
|
|
|
@ -139,6 +139,11 @@ extend class Actor
|
|||
{ // Must be monster, player, missile, touchy or vulnerable
|
||||
continue;
|
||||
}
|
||||
if (player && ShouldPassThroughPlayer(mo))
|
||||
{
|
||||
// Don't blast friendly players if collision is disabled.
|
||||
continue;
|
||||
}
|
||||
if (Distance2D(mo) > radius)
|
||||
{ // Out of range
|
||||
continue;
|
||||
|
|
Loading…
Reference in a new issue