mirror of
https://github.com/ErikasKontenis/SabrehavenServer.git
synced 2025-06-19 23:23:48 +02:00
introduce distanceWeaponsDropOnGround config
This commit is contained in:
parent
a27910e47c
commit
5f252eb434
@ -8,6 +8,7 @@ removeChargesFromRunes = true
|
|||||||
stairJumpExhaustion = 0
|
stairJumpExhaustion = 0
|
||||||
experienceByKillingPlayers = false
|
experienceByKillingPlayers = false
|
||||||
expFromPlayersLevelRange = 75
|
expFromPlayersLevelRange = 75
|
||||||
|
distanceWeaponsDropOnGround = false
|
||||||
|
|
||||||
-- Skull System
|
-- Skull System
|
||||||
banLength = 30 * 24 * 60 * 60
|
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.addMagicEffect(destTile->getPosition(), CONST_ME_POFF);
|
||||||
g_game.addDistanceEffect(attackerPos, destTile->getPosition(), distanceEffect);
|
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);
|
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);
|
g_game.addDistanceEffect(attackerPos, targetPos, distanceEffect);
|
||||||
Combat::doCombatHealth(attacker, target, combatDamage, combatParams);
|
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);
|
g_game.internalMoveItem(weapon->getParent(), target->getTile(), INDEX_WHEREEVER, weapon, 1, nullptr, FLAG_NOLIMIT);
|
||||||
}
|
}
|
||||||
} else if (weapon->getWeaponType() == WEAPON_WAND) {
|
} else if (weapon->getWeaponType() == WEAPON_WAND) {
|
||||||
|
@ -81,7 +81,7 @@ bool ConfigManager::load()
|
|||||||
boolean[STACK_CUMULATIVES] = getGlobalBoolean(L, "autoStackCumulatives", false);
|
boolean[STACK_CUMULATIVES] = getGlobalBoolean(L, "autoStackCumulatives", false);
|
||||||
boolean[BLOCK_HEIGHT] = getGlobalBoolean(L, "blockHeight", false);
|
boolean[BLOCK_HEIGHT] = getGlobalBoolean(L, "blockHeight", false);
|
||||||
boolean[DROP_ITEMS] = getGlobalBoolean(L, "dropItems", 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[DEFAULT_PRIORITY] = getGlobalString(L, "defaultPriority", "high");
|
||||||
string[SERVER_NAME] = getGlobalString(L, "serverName", "");
|
string[SERVER_NAME] = getGlobalString(L, "serverName", "");
|
||||||
|
@ -48,6 +48,7 @@ class ConfigManager
|
|||||||
STACK_CUMULATIVES,
|
STACK_CUMULATIVES,
|
||||||
BLOCK_HEIGHT,
|
BLOCK_HEIGHT,
|
||||||
DROP_ITEMS,
|
DROP_ITEMS,
|
||||||
|
DISTANCE_WEAPONS_DROP_ON_GROUND,
|
||||||
|
|
||||||
LAST_BOOLEAN_CONFIG /* this must be the last one */
|
LAST_BOOLEAN_CONFIG /* this must be the last one */
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user