From 952e47cfe473967cbef494b00d19ed0a64db2832 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sat, 10 Dec 2016 16:35:48 +0100 Subject: [PATCH] - renamed internal MELEERANGE constant to deconflict with Actor's MeleeRange member. --- src/b_func.cpp | 2 +- src/p_actionfunctions.cpp | 2 +- src/p_local.h | 2 +- wadsrc/static/zscript/constants.txt | 2 +- wadsrc/static/zscript/doom/scriptedmarine.txt | 4 ++-- wadsrc/static/zscript/doom/weaponfist.txt | 4 ++-- wadsrc/static/zscript/heretic/chicken.txt | 8 ++++---- wadsrc/static/zscript/heretic/weapongauntlets.txt | 2 +- wadsrc/static/zscript/heretic/weaponstaff.txt | 4 ++-- wadsrc/static/zscript/hexen/clericmace.txt | 8 ++++---- wadsrc/static/zscript/hexen/clericstaff.txt | 4 ++-- wadsrc/static/zscript/hexen/fighteraxe.txt | 6 +++--- wadsrc/static/zscript/hexen/fighterfist.txt | 8 ++++---- wadsrc/static/zscript/hexen/fighterhammer.txt | 2 +- wadsrc/static/zscript/hexen/magecone.txt | 2 +- wadsrc/static/zscript/hexen/pig.txt | 4 ++-- 16 files changed, 32 insertions(+), 32 deletions(-) diff --git a/src/b_func.cpp b/src/b_func.cpp index acd3077e6..4e62c9c4e 100644 --- a/src/b_func.cpp +++ b/src/b_func.cpp @@ -193,7 +193,7 @@ void DBot::Dofire (ticcmd_t *cmd) else { //*4 is for atmosphere, the chainsaws sounding and all.. - no_fire = (Dist > MELEERANGE*4); + no_fire = (Dist > DEFMELEERANGE*4); } } else if (player->ReadyWeapon->WeaponFlags & WIF_BOT_BFG) diff --git a/src/p_actionfunctions.cpp b/src/p_actionfunctions.cpp index 4b6113768..f1b4fee80 100644 --- a/src/p_actionfunctions.cpp +++ b/src/p_actionfunctions.cpp @@ -2093,7 +2093,7 @@ DEFINE_ACTION_FUNCTION(AStateProvider, A_CustomPunch) damage *= pr_cwpunch() % 8 + 1; angle = self->Angles.Yaw + pr_cwpunch.Random2() * (5.625 / 256); - if (range == 0) range = MELEERANGE; + if (range == 0) range = DEFMELEERANGE; pitch = P_AimLineAttack (self, angle, range, &t); // only use ammo when actually hitting something! diff --git a/src/p_local.h b/src/p_local.h index 12b4a40a3..ef702e018 100644 --- a/src/p_local.h +++ b/src/p_local.h @@ -62,7 +62,7 @@ extern int bmapnegy; #define TALKRANGE (128.) #define USERANGE (64.) -#define MELEERANGE (64.) +#define DEFMELEERANGE (64.) #define SAWRANGE (64.+(1./65536.)) // use meleerange + 1 so the puff doesn't skip the flash (i.e. plays all states) #define MISSILERANGE (32*64.) #define PLAYERMISSILERANGE (8192.) // [RH] New MISSILERANGE for players diff --git a/wadsrc/static/zscript/constants.txt b/wadsrc/static/zscript/constants.txt index 6597f8323..6f57b4222 100644 --- a/wadsrc/static/zscript/constants.txt +++ b/wadsrc/static/zscript/constants.txt @@ -871,7 +871,7 @@ enum ELineAttackFlags LAF_NOINTERACT = 8, } -const MELEERANGE = 64; +const DEFMELEERANGE = 64; const SAWRANGE = (64.+(1./65536.)); // use meleerange + 1 so the puff doesn't skip the flash (i.e. plays all states) const MISSILERANGE = (32*64); const PLAYERMISSILERANGE = 8192; // [RH] New MISSILERANGE for players diff --git a/wadsrc/static/zscript/doom/scriptedmarine.txt b/wadsrc/static/zscript/doom/scriptedmarine.txt index 22766ac90..9ecfbc460 100644 --- a/wadsrc/static/zscript/doom/scriptedmarine.txt +++ b/wadsrc/static/zscript/doom/scriptedmarine.txt @@ -372,8 +372,8 @@ class ScriptedMarine : Actor A_FaceTarget (); double ang = angle + random2[SMarinePunch]() * (5.625 / 256); - double pitch = AimLineAttack (ang, MELEERANGE); - LineAttack (ang, MELEERANGE, pitch, damage, 'Melee', "BulletPuff", true, t); + double pitch = AimLineAttack (ang, DEFMELEERANGE); + LineAttack (ang, DEFMELEERANGE, pitch, damage, 'Melee', "BulletPuff", true, t); // turn to face target if (t.linetarget) diff --git a/wadsrc/static/zscript/doom/weaponfist.txt b/wadsrc/static/zscript/doom/weaponfist.txt index 3c1cc992f..6f106e14a 100644 --- a/wadsrc/static/zscript/doom/weaponfist.txt +++ b/wadsrc/static/zscript/doom/weaponfist.txt @@ -65,9 +65,9 @@ extend class Actor damage *= 10; double ang = angle + Random2[Punch]() * (5.625 / 256); - double pitch = AimLineAttack (ang, MELEERANGE); + double pitch = AimLineAttack (ang, DEFMELEERANGE); - LineAttack (ang, MELEERANGE, pitch, damage, 'Melee', "BulletPuff", LAF_ISMELEEATTACK, t); + LineAttack (ang, DEFMELEERANGE, pitch, damage, 'Melee', "BulletPuff", LAF_ISMELEEATTACK, t); // turn to face target if (t.linetarget) diff --git a/wadsrc/static/zscript/heretic/chicken.txt b/wadsrc/static/zscript/heretic/chicken.txt index 5d6065f66..9f4429d50 100644 --- a/wadsrc/static/zscript/heretic/chicken.txt +++ b/wadsrc/static/zscript/heretic/chicken.txt @@ -77,8 +77,8 @@ class Beak : Weapon int damage = random[BeakAtk](1,3); double ang = angle; - double slope = AimLineAttack (ang, MELEERANGE); - LineAttack (ang, MELEERANGE, slope, damage, 'Melee', "BeakPuff", true, t); + double slope = AimLineAttack (ang, DEFMELEERANGE); + LineAttack (ang, DEFMELEERANGE, slope, damage, 'Melee', "BeakPuff", true, t); if (t.linetarget) { angle = t.angleFromSource; @@ -125,8 +125,8 @@ class BeakPowered : Beak int damage = random[BeakAtk](1,8) * 4; double ang = angle; - double slope = AimLineAttack (ang, MELEERANGE); - LineAttack (ang, MELEERANGE, slope, damage, 'Melee', "BeakPuff", true, t); + double slope = AimLineAttack (ang, DEFMELEERANGE); + LineAttack (ang, DEFMELEERANGE, slope, damage, 'Melee', "BeakPuff", true, t); if (t.linetarget) { angle = t.angleFromSource; diff --git a/wadsrc/static/zscript/heretic/weapongauntlets.txt b/wadsrc/static/zscript/heretic/weapongauntlets.txt index d06efe465..f80fe3b32 100644 --- a/wadsrc/static/zscript/heretic/weapongauntlets.txt +++ b/wadsrc/static/zscript/heretic/weapongauntlets.txt @@ -74,7 +74,7 @@ class Gauntlets : Weapon if (power) { damage = random[GauntletAtk](1, 8) * 2; - dist = 4*MELEERANGE; + dist = 4*DEFMELEERANGE; ang += random2[GauntletAtk]() * (2.8125 / 256); pufftype = "GauntletPuff2"; } diff --git a/wadsrc/static/zscript/heretic/weaponstaff.txt b/wadsrc/static/zscript/heretic/weaponstaff.txt index 6349bd61b..85126f503 100644 --- a/wadsrc/static/zscript/heretic/weaponstaff.txt +++ b/wadsrc/static/zscript/heretic/weaponstaff.txt @@ -54,8 +54,8 @@ class Staff : HereticWeapon return; } double ang = angle + Random2[StaffAtk]() * (5.625 / 256); - double slope = AimLineAttack (ang, MELEERANGE); - LineAttack (ang, MELEERANGE, slope, damage, 'Melee', puff, true, t); + double slope = AimLineAttack (ang, DEFMELEERANGE); + LineAttack (ang, DEFMELEERANGE, slope, damage, 'Melee', puff, true, t); if (t.linetarget) { //S_StartSound(player.mo, sfx_stfhit); diff --git a/wadsrc/static/zscript/hexen/clericmace.txt b/wadsrc/static/zscript/hexen/clericmace.txt index b6f42c7e4..2198e3cc4 100644 --- a/wadsrc/static/zscript/hexen/clericmace.txt +++ b/wadsrc/static/zscript/hexen/clericmace.txt @@ -66,10 +66,10 @@ class CWeapMace : ClericWeapon for (int j = 1; j >= -1; j -= 2) { double ang = angle + j*i*(45. / 16); - double slope = AimLineAttack(ang, 2 * MELEERANGE, t); + double slope = AimLineAttack(ang, 2 * DEFMELEERANGE, t); if (t.linetarget) { - LineAttack(ang, 2 * MELEERANGE, slope, damage, 'Melee', "HammerPuff", true, t); + LineAttack(ang, 2 * DEFMELEERANGE, slope, damage, 'Melee', "HammerPuff", true, t); if (t.linetarget != null) { AdjustPlayerAngle(t); @@ -81,7 +81,7 @@ class CWeapMace : ClericWeapon // didn't find any creatures, so try to strike any walls weaponspecial = 0; - double slope = AimLineAttack (angle, MELEERANGE); - LineAttack (angle, MELEERANGE, slope, damage, 'Melee', "HammerPuff"); + double slope = AimLineAttack (angle, DEFMELEERANGE); + LineAttack (angle, DEFMELEERANGE, slope, damage, 'Melee', "HammerPuff"); } } diff --git a/wadsrc/static/zscript/hexen/clericstaff.txt b/wadsrc/static/zscript/hexen/clericstaff.txt index 0d7ca0a99..20efb0960 100644 --- a/wadsrc/static/zscript/hexen/clericstaff.txt +++ b/wadsrc/static/zscript/hexen/clericstaff.txt @@ -74,10 +74,10 @@ class CWeapStaff : ClericWeapon for (int j = 1; j >= -1; j -= 2) { double ang = angle + j*i*(45. / 16); - double slope = AimLineAttack(ang, 1.5 * MELEERANGE, t, 0., ALF_CHECK3D); + double slope = AimLineAttack(ang, 1.5 * DEFMELEERANGE, t, 0., ALF_CHECK3D); if (t.linetarget) { - LineAttack(ang, 1.5 * MELEERANGE, slope, damage, 'Melee', "CStaffPuff", false, t); + LineAttack(ang, 1.5 * DEFMELEERANGE, slope, damage, 'Melee', "CStaffPuff", false, t); if (t.linetarget != null) { angle = t.angleFromSource; diff --git a/wadsrc/static/zscript/hexen/fighteraxe.txt b/wadsrc/static/zscript/hexen/fighteraxe.txt index 1ff44a52f..ccf8b5294 100644 --- a/wadsrc/static/zscript/hexen/fighteraxe.txt +++ b/wadsrc/static/zscript/hexen/fighteraxe.txt @@ -3,7 +3,7 @@ class FWeapAxe : FighterWeapon { - const AXERANGE = (2.25 * MELEERANGE); + const AXERANGE = (2.25 * DEFMELEERANGE); Default { @@ -273,8 +273,8 @@ class FWeapAxe : FighterWeapon // didn't find any creatures, so try to strike any walls self.weaponspecial = 0; - double slope = AimLineAttack (angle, MELEERANGE); - LineAttack (angle, MELEERANGE, slope, damage, 'Melee', pufftype, true); + double slope = AimLineAttack (angle, DEFMELEERANGE); + LineAttack (angle, DEFMELEERANGE, slope, damage, 'Melee', pufftype, true); } } diff --git a/wadsrc/static/zscript/hexen/fighterfist.txt b/wadsrc/static/zscript/hexen/fighterfist.txt index 289822789..4975bbd62 100644 --- a/wadsrc/static/zscript/hexen/fighterfist.txt +++ b/wadsrc/static/zscript/hexen/fighterfist.txt @@ -56,7 +56,7 @@ class FWeapFist : FighterWeapon Class pufftype; FTranslatedLineTarget t; - double slope = AimLineAttack (angle, 2*MELEERANGE, t); + double slope = AimLineAttack (angle, 2*DEFMELEERANGE, t); if (t.linetarget != null) { if (++weaponspecial >= 3) @@ -69,7 +69,7 @@ class FWeapFist : FighterWeapon { pufftype = "PunchPuff"; } - LineAttack (angle, 2*MELEERANGE, slope, damage, 'Melee', pufftype, true, t); + LineAttack (angle, 2*DEFMELEERANGE, slope, damage, 'Melee', pufftype, true, t); if (t.linetarget != null) { // The mass threshold has been changed to CommanderKeen's value which has been used most often for 'unmovable' stuff. @@ -117,8 +117,8 @@ class FWeapFist : FighterWeapon // didn't find any creatures, so try to strike any walls weaponspecial = 0; - double slope = AimLineAttack (angle, MELEERANGE); - LineAttack (angle, MELEERANGE, slope, damage, 'Melee', "PunchPuff", true); + double slope = AimLineAttack (angle, DEFMELEERANGE); + LineAttack (angle, DEFMELEERANGE, slope, damage, 'Melee', "PunchPuff", true); } } diff --git a/wadsrc/static/zscript/hexen/fighterhammer.txt b/wadsrc/static/zscript/hexen/fighterhammer.txt index f1b06b75c..27d85bdab 100644 --- a/wadsrc/static/zscript/hexen/fighterhammer.txt +++ b/wadsrc/static/zscript/hexen/fighterhammer.txt @@ -3,7 +3,7 @@ class FWeapHammer : FighterWeapon { - const HAMMER_RANGE = 1.5 * MELEERANGE; + const HAMMER_RANGE = 1.5 * DEFMELEERANGE; Default { diff --git a/wadsrc/static/zscript/hexen/magecone.txt b/wadsrc/static/zscript/hexen/magecone.txt index 2bbd58f3d..a26ad256c 100644 --- a/wadsrc/static/zscript/hexen/magecone.txt +++ b/wadsrc/static/zscript/hexen/magecone.txt @@ -72,7 +72,7 @@ class MWeapFrost : MageWeapon for (int i = 0; i < 16; i++) { double ang = angle + i*(45./16); - double slope = AimLineAttack (ang, MELEERANGE, t, 0., ALF_CHECK3D); + double slope = AimLineAttack (ang, DEFMELEERANGE, t, 0., ALF_CHECK3D); if (t.linetarget) { t.linetarget.DamageMobj (self, self, damage, 'Ice', DMG_USEANGLE, t.angleFromSource); diff --git a/wadsrc/static/zscript/hexen/pig.txt b/wadsrc/static/zscript/hexen/pig.txt index 9f62e661e..2885956e5 100644 --- a/wadsrc/static/zscript/hexen/pig.txt +++ b/wadsrc/static/zscript/hexen/pig.txt @@ -70,8 +70,8 @@ class Snout : Weapon int damage = random[SnoutAttack](3, 6); double ang = angle; - double slope = AimLineAttack(ang, MELEERANGE); - Actor puff = LineAttack(ang, MELEERANGE, slope, damage, 'Melee', "SnoutPuff", true, t); + double slope = AimLineAttack(ang, DEFMELEERANGE); + Actor puff = LineAttack(ang, DEFMELEERANGE, slope, damage, 'Melee', "SnoutPuff", true, t); A_PlaySound("PigActive", CHAN_VOICE); if(t.linetarget) {