Enhanced FastProjectile trails.

- Trails now copy pitch, and set the projectile as the target.
- Added GETOWNER flag. Using it sets the owner of the fast projectile as the target instead, if it has an owner.
This commit is contained in:
Major Cooke 2016-09-04 08:53:20 -05:00 committed by Christoph Oelckers
parent 2e8aa53e6a
commit ce13b5c6e1
3 changed files with 9 additions and 2 deletions

View file

@ -283,7 +283,7 @@ enum ActorFlag4
enum ActorFlag5 enum ActorFlag5
{ {
MF5_DONTDRAIN = 0x00000001, // cannot be drained health from. MF5_DONTDRAIN = 0x00000001, // cannot be drained health from.
/* FREE SLOT 0x00000002*/ MF5_GETOWNER = 0x00000002,
MF5_NODROPOFF = 0x00000004, // cannot drop off under any circumstances. MF5_NODROPOFF = 0x00000004, // cannot drop off under any circumstances.
MF5_NOFORWARDFALL = 0x00000008, // Does not make any actor fall forward by being damaged by this MF5_NOFORWARDFALL = 0x00000008, // Does not make any actor fall forward by being damaged by this
MF5_COUNTSECRET = 0x00000010, // From Doom 64: actor acts like a secret MF5_COUNTSECRET = 0x00000010, // From Doom 64: actor acts like a secret

View file

@ -166,8 +166,14 @@ void AFastProjectile::Effect()
if (trail != NULL) if (trail != NULL)
{ {
AActor *act = Spawn (trail, PosAtZ(hitz), ALLOW_REPLACE); AActor *act = Spawn (trail, PosAtZ(hitz), ALLOW_REPLACE);
if (act != NULL) if (act != nullptr)
{ {
if ((flags5 & MF5_GETOWNER) && (target != nullptr))
act->target = target;
else
act->target = this;
act->Angles.Pitch = Angles.Pitch;
act->Angles.Yaw = Angles.Yaw; act->Angles.Yaw = Angles.Yaw;
} }
} }

View file

@ -182,6 +182,7 @@ static FFlagDef ActorFlagDefs[]=
DEFINE_FLAG(MF4, BOSSDEATH, AActor, flags4), DEFINE_FLAG(MF4, BOSSDEATH, AActor, flags4),
DEFINE_FLAG(MF5, DONTDRAIN, AActor, flags5), DEFINE_FLAG(MF5, DONTDRAIN, AActor, flags5),
DEFINE_FLAG(MF5, GETOWNER, AActor, flags5),
DEFINE_FLAG(MF5, NODROPOFF, AActor, flags5), DEFINE_FLAG(MF5, NODROPOFF, AActor, flags5),
DEFINE_FLAG(MF5, NOFORWARDFALL, AActor, flags5), DEFINE_FLAG(MF5, NOFORWARDFALL, AActor, flags5),
DEFINE_FLAG(MF5, COUNTSECRET, AActor, flags5), DEFINE_FLAG(MF5, COUNTSECRET, AActor, flags5),