From 0fae305224780eb7b47241cfbe4ae5a44eae276b Mon Sep 17 00:00:00 2001 From: Randy Heit Date: Tue, 15 May 2012 22:05:14 +0000 Subject: [PATCH] - Fixed: A_LookEx did not default to a 180 degree cone. SVN r3655 (trunk) --- src/p_enemy.cpp | 7 ++++--- src/thingdef/thingdef.h | 2 ++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/p_enemy.cpp b/src/p_enemy.cpp index eb492118c..f74c94e8e 100644 --- a/src/p_enemy.cpp +++ b/src/p_enemy.cpp @@ -1127,7 +1127,7 @@ bool P_IsVisible(AActor *lookee, AActor *other, INTBOOL allaround, FLookExParams else { mindist = maxdist = 0; - fov = allaround? 0 : ANGLE_180; + fov = allaround ? 0 : ANGLE_180; } fixed_t dist = P_AproxDistance (other->x - lookee->x, other->y - lookee->y); @@ -1832,12 +1832,13 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_LookEx) ACTION_PARAM_FIXED(minseedist, 1); ACTION_PARAM_FIXED(maxseedist, 2); ACTION_PARAM_FIXED(maxheardist, 3); - ACTION_PARAM_ANGLE(fov, 4); + ACTION_PARAM_DOUBLE(fov_f, 4); ACTION_PARAM_STATE(seestate, 5); AActor *targ = NULL; // Shuts up gcc fixed_t dist; - FLookExParams params = {fov, minseedist, maxseedist, maxheardist, flags, seestate }; + angle_t fov = (fov_f == 0) ? 180 : angle_t(fov_f * ANGLE_90 / 90); + FLookExParams params = { fov, minseedist, maxseedist, maxheardist, flags, seestate }; if (self->flags5 & MF5_INCONVERSATION) return; diff --git a/src/thingdef/thingdef.h b/src/thingdef/thingdef.h index 2f0656735..503f67eb5 100644 --- a/src/thingdef/thingdef.h +++ b/src/thingdef/thingdef.h @@ -409,6 +409,8 @@ FName EvalExpressionName (DWORD x, AActor *self); fixed_t var = EvalExpressionFix(ParameterIndex+i, self); #define ACTION_PARAM_FLOAT(var,i) \ float var = float(EvalExpressionF(ParameterIndex+i, self)); +#define ACTION_PARAM_DOUBLE(var,i) \ + double var = EvalExpressionF(ParameterIndex+i, self); #define ACTION_PARAM_CLASS(var,i) \ const PClass *var = EvalExpressionClass(ParameterIndex+i, self); #define ACTION_PARAM_STATE(var,i) \