Add damagesource

This commit is contained in:
jekyllgrim 2024-06-03 12:25:12 +03:00 committed by Ricardo Luís Vaz Silva
commit 83165dccbf
4 changed files with 7 additions and 0 deletions

View file

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