Skip to content

Commit

Permalink
fix: block some weapons from chain system (#2361)
Browse files Browse the repository at this point in the history
Fixed an issue with crossbows/bows not attacking correctly.
  • Loading branch information
dudantas authored Mar 2, 2024
1 parent 17a1895 commit 34fe193
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/creatures/combat/combat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -941,6 +941,11 @@ void Combat::setupChain(const std::shared_ptr<Weapon> &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<uint32_t> areaList = {
0, 0, 0, 1, 0, 0, 0,
Expand All @@ -957,7 +962,6 @@ void Combat::setupChain(const std::shared_ptr<Weapon> &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);
}
Expand Down

0 comments on commit 34fe193

Please sign in to comment.