mirror of
https://github.com/ErikasKontenis/SabrehavenServer.git
synced 2025-06-19 15:13:47 +02:00
introduce distanceWeaponsDropOnGround config
This commit is contained in:
parent
a27910e47c
commit
5f252eb434
@ -8,6 +8,7 @@ removeChargesFromRunes = true
|
||||
stairJumpExhaustion = 0
|
||||
experienceByKillingPlayers = false
|
||||
expFromPlayersLevelRange = 75
|
||||
distanceWeaponsDropOnGround = false
|
||||
|
||||
-- Skull System
|
||||
banLength = 30 * 24 * 60 * 60
|
||||
|
@ -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) {
|
||||
|
@ -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", "");
|
||||
|
@ -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 */
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user