Skip to content

Commit 75ba89d

Browse files
authored
fix: remove player from party on death (#3384)
1 parent 6bea704 commit 75ba89d

File tree

4 files changed

+7
-0
lines changed

4 files changed

+7
-0
lines changed

config.lua.dist

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -346,6 +346,7 @@ freeQuestStage = 1
346346
-- death penalty formula. For the old formula, set it to 10. For
347347
-- no skill/experience loss, set it to 0.
348348
deathLosePercent = -1
349+
leavePartyOnDeath = false
349350

350351
-- Houses
351352
-- NOTE: set housePriceEachSQM to -1 to disable the ingame buy house functionality

src/config/config_enums.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ enum ConfigKey_t : uint16_t {
127127
INVENTORY_GLOW,
128128
IP,
129129
KICK_AFTER_MINUTES,
130+
LEAVE_PARTY_ON_DEATH,
130131
LOCATION,
131132
LOGIN_PORT,
132133
LOGLEVEL,

src/config/configmanager.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,7 @@ bool ConfigManager::load() {
159159
loadBoolConfig(L, WARN_UNSAFE_SCRIPTS, "warnUnsafeScripts", true);
160160
loadBoolConfig(L, XP_DISPLAY_MODE, "experienceDisplayRates", true);
161161
loadBoolConfig(L, CYCLOPEDIA_HOUSE_AUCTION, "toggleCyclopediaHouseAuction", true);
162+
loadBoolConfig(L, LEAVE_PARTY_ON_DEATH, "leavePartyOnDeath", false);
162163

163164
loadFloatConfig(L, BESTIARY_RATE_CHARM_SHOP_PRICE, "bestiaryRateCharmShopPrice", 1.0);
164165
loadFloatConfig(L, COMBAT_CHAIN_SKILL_FORMULA_AXE, "combatChainSkillFormulaAxe", 0.9);

src/creatures/players/player.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3852,6 +3852,10 @@ void Player::despawn() {
38523852
player->vip()->notifyStatusChange(static_self_cast<Player>(), VipStatus_t::Pending, false);
38533853
}
38543854

3855+
if (m_party && g_configManager().getBoolean(LEAVE_PARTY_ON_DEATH)) {
3856+
m_party->leaveParty(static_self_cast<Player>());
3857+
}
3858+
38553859
setDead(true);
38563860
}
38573861

0 commit comments

Comments
 (0)