- Added CPF_NOTURN flag for A_CustomPunch.

This commit is contained in:
Edoardo Prezioso 2014-11-14 12:18:46 +01:00
parent e0eca1e0f5
commit fd354dbe9a
2 changed files with 10 additions and 5 deletions

View File

@ -1384,6 +1384,7 @@ enum
CPF_DAGGER = 2,
CPF_PULLIN = 4,
CPF_NORANDOMPUFFZ = 8,
CPF_NOTURN = 16,
};
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_CustomPunch)
@ -1424,7 +1425,6 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_CustomPunch)
P_LineAttack (self, angle, Range, pitch, Damage, NAME_Melee, PuffType, puffFlags, &linetarget, &actualdamage);
// turn to face target
if (linetarget)
{
if (LifeSteal && !(linetarget->flags5 & MF5_DONTDRAIN))
@ -1435,10 +1435,14 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_CustomPunch)
S_Sound (self, CHAN_WEAPON, weapon->AttackSound, 1, ATTN_NORM);
}
self->angle = R_PointToAngle2 (self->x,
self->y,
linetarget->x,
linetarget->y);
if (!(flags & CPF_NOTURN))
{
// turn to face target
self->angle = R_PointToAngle2 (self->x,
self->y,
linetarget->x,
linetarget->y);
}
if (flags & CPF_PULLIN) self->flags |= MF_JUSTATTACKED;
if (flags & CPF_DAGGER) P_DaggerAlert (self, linetarget);

View File

@ -175,6 +175,7 @@ const int CPF_USEAMMO = 1;
const int CPF_DAGGER = 2;
const int CPF_PULLIN = 4;
const int CPF_NORANDOMPUFFZ = 8;
const int CPF_NOTURN = 16;
// Flags for A_CustomMissile
const int FPF_AIMATANGLE = 1;