introduce distanceWeaponsDropOnGround config

This commit is contained in:
ErikasKontenis 2020-02-17 18:54:49 +02:00
parent a27910e47c
commit 5f252eb434
4 changed files with 5 additions and 3 deletions

View File

@ -8,6 +8,7 @@ removeChargesFromRunes = true
stairJumpExhaustion = 0
experienceByKillingPlayers = false
expFromPlayersLevelRange = 75
distanceWeaponsDropOnGround = false
-- Skull System
banLength = 30 * 24 * 60 * 60

View File

@ -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) {

View File

@ -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", "");

View File

@ -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 */
};