This commit is contained in:
Christoph Oelckers 2014-11-15 08:58:36 +01:00
commit 23bb12b0b8
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;