From aac273b7d44bb8c1a6f9233133a2a48bad3dded4 Mon Sep 17 00:00:00 2001 From: Eduardo Dantas Date: Sat, 2 Mar 2024 16:22:12 -0300 Subject: [PATCH] fix: block some weapons from chain system --- src/creatures/combat/combat.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/creatures/combat/combat.cpp b/src/creatures/combat/combat.cpp index 7456f572938..5b5ba5f037b 100644 --- a/src/creatures/combat/combat.cpp +++ b/src/creatures/combat/combat.cpp @@ -941,6 +941,11 @@ void Combat::setupChain(const std::shared_ptr &weapon) { return; } + const auto &weaponType = weapon->getWeaponType(); + if (weaponType == WEAPON_NONE || weaponType == WEAPON_SHIELD || weaponType == WEAPON_AMMO || weaponType == WEAPON_DISTANCE) { + return; + } + // clang-format off static std::list areaList = { 0, 0, 0, 1, 0, 0, 0, @@ -957,7 +962,6 @@ void Combat::setupChain(const std::shared_ptr &weapon) { setArea(area); g_logger().trace("Weapon: {}, element type: {}", Item::items[weapon->getID()].name, weapon->params.combatType); setParam(COMBAT_PARAM_TYPE, weapon->params.combatType); - const auto &weaponType = weapon->getWeaponType(); if (weaponType != WEAPON_WAND) { setParam(COMBAT_PARAM_BLOCKARMOR, true); }