From 864796a6a227cc6aea25a9c461493792b705f076 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sat, 24 Nov 2018 18:42:10 +0100 Subject: [PATCH] - removed MeleeWeapon flag from the tomed PhoenixRod and the fighterhammer. In both cases, having this flag on will render the monster-backing-off-check for melee attacks ineffective because it would misinterpret these weapons as close range only - which they aren't. Even for the PhoenixRod the range is longer than what gets checked here. As a consequence, the bot's check for missile shooting melee weapons has also become pointless because no such weapon is defined anymore. --- src/b_func.cpp | 21 ++----------------- .../static/zscript/heretic/weaponphoenix.txt | 1 - wadsrc/static/zscript/hexen/fighterhammer.txt | 2 +- 3 files changed, 3 insertions(+), 21 deletions(-) diff --git a/src/b_func.cpp b/src/b_func.cpp index 3014e1bdd..eae0ce899 100644 --- a/src/b_func.cpp +++ b/src/b_func.cpp @@ -211,25 +211,8 @@ void DBot::Dofire (ticcmd_t *cmd) //FIRE EACH TYPE OF WEAPON DIFFERENT: Here should all the different weapons go. if (player->ReadyWeapon->WeaponFlags & WIF_MELEEWEAPON) { - if ((player->ReadyWeapon->ProjectileType != NULL)) - { - if (player->ReadyWeapon->CheckAmmo (AWeapon::PrimaryFire, false, true)) - { - // This weapon can fire a projectile and has enough ammo to do so - goto shootmissile; - } - else if (!(player->ReadyWeapon->WeaponFlags & WIF_AMMO_OPTIONAL)) - { - // Ammo is required, so don't shoot. This is for weapons that shoot - // missiles that die at close range, such as the powered-up Phoneix Rod. - return; - } - } - else - { - //*4 is for atmosphere, the chainsaws sounding and all.. - no_fire = (Dist > DEFMELEERANGE*4); - } + //*4 is for atmosphere, the chainsaws sounding and all.. + no_fire = (Dist > DEFMELEERANGE*4); } else if (player->ReadyWeapon->WeaponFlags & WIF_BOT_BFG) { diff --git a/wadsrc/static/zscript/heretic/weaponphoenix.txt b/wadsrc/static/zscript/heretic/weaponphoenix.txt index 162184f6e..5feeb46d0 100644 --- a/wadsrc/static/zscript/heretic/weaponphoenix.txt +++ b/wadsrc/static/zscript/heretic/weaponphoenix.txt @@ -73,7 +73,6 @@ class PhoenixRodPowered : PhoenixRod Default { +WEAPON.POWERED_UP - +WEAPON.MELEEWEAPON Weapon.SisterWeapon "PhoenixRod"; Weapon.AmmoGive 0; Tag "$TAG_PHOENIXRODP"; diff --git a/wadsrc/static/zscript/hexen/fighterhammer.txt b/wadsrc/static/zscript/hexen/fighterhammer.txt index 27d85bdab..82f2040d9 100644 --- a/wadsrc/static/zscript/hexen/fighterhammer.txt +++ b/wadsrc/static/zscript/hexen/fighterhammer.txt @@ -9,7 +9,7 @@ class FWeapHammer : FighterWeapon { +BLOODSPLATTER Weapon.SelectionOrder 900; - +WEAPON.AMMO_OPTIONAL +WEAPON.MELEEWEAPON + +WEAPON.AMMO_OPTIONAL Weapon.AmmoUse1 3; Weapon.AmmoGive1 25; Weapon.KickBack 150;