diff --git a/config.lua b/config.lua index 8ea8c12..75cbcff 100644 --- a/config.lua +++ b/config.lua @@ -8,6 +8,7 @@ removeChargesFromRunes = true stairJumpExhaustion = 0 experienceByKillingPlayers = false expFromPlayersLevelRange = 75 +distanceWeaponsDropOnGround = false -- Skull System banLength = 30 * 24 * 60 * 60 diff --git a/src/combat.cpp b/src/combat.cpp index e63bc0f..5d62a55 100644 --- a/src/combat.cpp +++ b/src/combat.cpp @@ -1120,7 +1120,7 @@ bool Combat::rangeAttack(Creature* attacker, Creature* target, fightMode_t fight g_game.addMagicEffect(destTile->getPosition(), CONST_ME_POFF); g_game.addDistanceEffect(attackerPos, destTile->getPosition(), distanceEffect); - if (moveWeapon) { + if (moveWeapon && g_config.getBoolean(ConfigManager::DISTANCE_WEAPONS_DROP_ON_GROUND)) { g_game.internalMoveItem(weapon->getParent(), destTile, INDEX_WHEREEVER, weapon, 1, nullptr, FLAG_NOLIMIT); } @@ -1130,7 +1130,7 @@ bool Combat::rangeAttack(Creature* attacker, Creature* target, fightMode_t fight g_game.addDistanceEffect(attackerPos, targetPos, distanceEffect); Combat::doCombatHealth(attacker, target, combatDamage, combatParams); - if (moveWeapon) { + if (moveWeapon && g_config.getBoolean(ConfigManager::DISTANCE_WEAPONS_DROP_ON_GROUND)) { g_game.internalMoveItem(weapon->getParent(), target->getTile(), INDEX_WHEREEVER, weapon, 1, nullptr, FLAG_NOLIMIT); } } else if (weapon->getWeaponType() == WEAPON_WAND) { diff --git a/src/configmanager.cpp b/src/configmanager.cpp index 5136cbf..0498925 100644 --- a/src/configmanager.cpp +++ b/src/configmanager.cpp @@ -81,7 +81,7 @@ bool ConfigManager::load() boolean[STACK_CUMULATIVES] = getGlobalBoolean(L, "autoStackCumulatives", false); boolean[BLOCK_HEIGHT] = getGlobalBoolean(L, "blockHeight", false); boolean[DROP_ITEMS] = getGlobalBoolean(L, "dropItems", false); - + boolean[DISTANCE_WEAPONS_DROP_ON_GROUND] = getGlobalBoolean(L, "distanceWeaponsDropOnGround", true); string[DEFAULT_PRIORITY] = getGlobalString(L, "defaultPriority", "high"); string[SERVER_NAME] = getGlobalString(L, "serverName", ""); diff --git a/src/configmanager.h b/src/configmanager.h index e1c20f1..c8cf68d 100644 --- a/src/configmanager.h +++ b/src/configmanager.h @@ -48,6 +48,7 @@ class ConfigManager STACK_CUMULATIVES, BLOCK_HEIGHT, DROP_ITEMS, + DISTANCE_WEAPONS_DROP_ON_GROUND, LAST_BOOLEAN_CONFIG /* this must be the last one */ };