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:
parent
a7f76fe8b9
commit
5b98eade91
4 changed files with 115 additions and 39 deletions
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue