From edeed7673aa29bb2ac4664fb942f4788fc82b1b2 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Tue, 28 Oct 2008 22:33:00 +0000 Subject: [PATCH] - Fixed: The railgun attack functions still read their puff parameters as names even though they are now passed as class pointers. SVN r1281 (trunk) --- docs/rh-log.txt | 2 ++ src/p_local.h | 2 +- src/p_map.cpp | 4 ++-- src/thingdef/thingdef_codeptr.cpp | 8 ++++---- 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/docs/rh-log.txt b/docs/rh-log.txt index a8036fd34..ff3b59bf8 100644 --- a/docs/rh-log.txt +++ b/docs/rh-log.txt @@ -1,4 +1,6 @@ October 28, 2008 (Changes by Graf Zahl) +- Fixed: The railgun attack functions still read their puff parameters as names + even though they are now passed as class pointers. - Fixed: The state parser counted one parameter too many for a varargs function. - Fixed: FStateExpressions could copy unresolved default parameter expressions. When these were resolved and changed later all copied pointers pointed to diff --git a/src/p_local.h b/src/p_local.h index 37c08f410..e2fd46142 100644 --- a/src/p_local.h +++ b/src/p_local.h @@ -386,7 +386,7 @@ void P_TraceBleed (int damage, fixed_t x, fixed_t y, fixed_t z, AActor *target, void P_TraceBleed (int damage, AActor *target, angle_t angle, int pitch); void P_TraceBleed (int damage, AActor *target, AActor *missile); // missile version void P_TraceBleed (int damage, AActor *target); // random direction version -void P_RailAttack (AActor *source, int damage, int offset, int color1 = 0, int color2 = 0, float maxdiff = 0, bool silent = false, FName puff = NAME_BulletPuff); // [RH] Shoot a railgun +void P_RailAttack (AActor *source, int damage, int offset, int color1 = 0, int color2 = 0, float maxdiff = 0, bool silent = false, const PClass *puff = NULL); // [RH] Shoot a railgun bool P_HitFloor (AActor *thing); bool P_HitWater (AActor *thing, sector_t *sec, fixed_t splashz=FIXED_MIN); bool P_CheckMissileSpawn (AActor *missile); diff --git a/src/p_map.cpp b/src/p_map.cpp index da750cb6d..00eb8e446 100644 --- a/src/p_map.cpp +++ b/src/p_map.cpp @@ -2970,7 +2970,7 @@ static bool ProcessRailHit (FTraceResults &res) return true; } -void P_RailAttack (AActor *source, int damage, int offset, int color1, int color2, float maxdiff, bool silent, FName puff) +void P_RailAttack (AActor *source, int damage, int offset, int color1, int color2, float maxdiff, bool silent, const PClass *puffclass) { fixed_t vx, vy, vz; angle_t angle, pitch; @@ -3063,7 +3063,7 @@ void P_RailAttack (AActor *source, int damage, int offset, int color1, int color // Now hurt anything the trace hit unsigned int i; - const PClass *puffclass = PClass::FindClass(puff); + if (puffclass == NULL) puffclass = PClass::FindClass(NAME_BulletPuff); AActor *puffDefaults = puffclass == NULL? NULL : GetDefaultByType (puffclass); FName damagetype = (puffDefaults == NULL || puffDefaults->DamageType == NAME_None) ? FName(NAME_Railgun) : puffDefaults->DamageType; diff --git a/src/thingdef/thingdef_codeptr.cpp b/src/thingdef/thingdef_codeptr.cpp index 524b191bc..fc576c87b 100644 --- a/src/thingdef/thingdef_codeptr.cpp +++ b/src/thingdef/thingdef_codeptr.cpp @@ -1053,7 +1053,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_RailAttack) ACTION_PARAM_COLOR(Color2, 4); ACTION_PARAM_BOOL(Silent, 5); ACTION_PARAM_FLOAT(MaxDiff, 6); - ACTION_PARAM_NAME(PuffTypeName, 7); + ACTION_PARAM_CLASS(PuffType, 7); if (!self->player) return; @@ -1065,7 +1065,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_RailAttack) if (!weapon->DepleteAmmo(weapon->bAltFire, true)) return; // out of ammo } - P_RailAttack (self, Damage, Spawnofs_XY, Color1, Color2, MaxDiff, Silent, PuffTypeName); + P_RailAttack (self, Damage, Spawnofs_XY, Color1, Color2, MaxDiff, Silent, PuffType); } //========================================================================== @@ -1084,7 +1084,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_CustomRailgun) ACTION_PARAM_BOOL(Silent, 4); ACTION_PARAM_BOOL(aim, 5); ACTION_PARAM_FLOAT(MaxDiff, 6); - ACTION_PARAM_NAME(PuffTypeName, 7); + ACTION_PARAM_CLASS(PuffType, 7); if (aim && self->target == NULL) { @@ -1122,7 +1122,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_CustomRailgun) } } - P_RailAttack (self, Damage, Spawnofs_XY, Color1, Color2, MaxDiff, Silent, PuffTypeName); + P_RailAttack (self, Damage, Spawnofs_XY, Color1, Color2, MaxDiff, Silent, PuffType); } //===========================================================================