mirror of
https://github.com/ZDoom/gzdoom.git
synced 2025-03-26 04:31:22 +00:00
Add damagesource
This commit is contained in:
parent
f13bc09840
commit
83165dccbf
4 changed files with 7 additions and 0 deletions
|
@ -1233,6 +1233,7 @@ public:
|
|||
TObjPtr<AActor*> alternative; // (Un)Morphed actors stored here. Those with the MF_UNMORPHED flag are the originals.
|
||||
TObjPtr<AActor*> tracer; // Thing being chased/attacked for tracers
|
||||
TObjPtr<AActor*> master; // Thing which spawned this one (prevents mutual attacks)
|
||||
TObjPtr<AActor*> damagesource; // [AA] Thing that fired a hitscan using this actor as a puff
|
||||
|
||||
int tid; // thing identifier
|
||||
int special; // special
|
||||
|
|
|
@ -168,6 +168,7 @@ IMPLEMENT_POINTERS_START(AActor)
|
|||
IMPLEMENT_POINTER(target)
|
||||
IMPLEMENT_POINTER(lastenemy)
|
||||
IMPLEMENT_POINTER(tracer)
|
||||
IMPLEMENT_POINTER(damagesource)
|
||||
IMPLEMENT_POINTER(goal)
|
||||
IMPLEMENT_POINTER(LastLookActor)
|
||||
IMPLEMENT_POINTER(Inventory)
|
||||
|
@ -6286,6 +6287,9 @@ AActor *P_SpawnPuff (AActor *source, PClassActor *pufftype, const DVector3 &pos1
|
|||
if ( puff && (puff->flags5 & MF5_PUFFGETSOWNER))
|
||||
puff->target = source;
|
||||
|
||||
// [AA] Track the source of the attack unconditionally in a separate field.
|
||||
puff->damagesource = source;
|
||||
|
||||
// Angle is the opposite of the hit direction (i.e. the puff faces the source.)
|
||||
puff->Angles.Yaw = hitdir + DAngle::fromDeg(180);
|
||||
|
||||
|
|
|
@ -2005,6 +2005,7 @@ DEFINE_FIELD(AActor, strafecount)
|
|||
DEFINE_FIELD(AActor, target)
|
||||
DEFINE_FIELD(AActor, master)
|
||||
DEFINE_FIELD(AActor, tracer)
|
||||
DEFINE_FIELD(AActor, damagesource)
|
||||
DEFINE_FIELD(AActor, LastHeard)
|
||||
DEFINE_FIELD(AActor, lastenemy)
|
||||
DEFINE_FIELD(AActor, LastLookActor)
|
||||
|
|
|
@ -148,6 +148,7 @@ class Actor : Thinker native
|
|||
native Actor Target;
|
||||
native Actor Master;
|
||||
native Actor Tracer;
|
||||
native Actor DamageSource;
|
||||
native Actor LastHeard;
|
||||
native Actor LastEnemy;
|
||||
native Actor LastLookActor;
|
||||
|
|
Loading…
Reference in a new issue