Moved all the handling of MF_SHADOW for attacks into its' own file.

Also changed all the individual flag checks into one generic inline function.
This commit is contained in:
inkoalawetrust 2023-01-15 14:54:23 +02:00 committed by Rachael Alexanderson
commit 5b98eade91
4 changed files with 115 additions and 39 deletions

View file

@ -50,6 +50,7 @@
#include "vm.h"
#include "actorinlines.h"
#include "a_ceiling.h"
#include "shadowinlines.h"
#include "gi.h"
@ -3021,12 +3022,7 @@ void A_Face(AActor *self, AActor *other, DAngle max_turn, DAngle max_pitch, DAng
}
// This will never work well if the turn angle is limited.
if (max_turn == nullAngle && (self->Angles.Yaw == other_angle) && other->flags & MF_SHADOW && !(self->flags6 & MF6_SEEINVISIBLE) )
{
self->Angles.Yaw += DAngle::fromDeg(pr_facetarget.Random2() * (45 / 256.));
}
A_Face_ShadowHandling(self,other,max_turn,other_angle);
}
void A_FaceTarget(AActor *self)
@ -3073,10 +3069,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_MonsterRail)
// Let the aim trail behind the player
self->Angles.Yaw = self->AngleTo(self->target, -self->target->Vel.X * 3, -self->target->Vel.Y * 3);
if (self->target->flags & MF_SHADOW && !(self->flags6 & MF6_SEEINVISIBLE))
{
self->Angles.Yaw += DAngle::fromDeg(pr_railface.Random2() * 45./256);
}
A_MonsterRail_ShadowHandling(self);
FRailParams p;