Skip to content

Commit

Permalink
[Bug Fix] Cursor Coin Upon Death (EQEmu#3020)
Browse files Browse the repository at this point in the history
* Update corpse.cpp

* Add rule toggle.

---------

Co-authored-by: Kinglykrab <kinglykrab@gmail.com>
  • Loading branch information
2 people authored and nytmyr committed Mar 24, 2023
1 parent bca58d4 commit 5ae3921
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
1 change: 1 addition & 0 deletions common/ruletypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,7 @@ RULE_REAL(Character, FullGroupEXPModifier, 2.16, "Sets the group experience modi
RULE_BOOL(Character, IgnoreLevelBasedHasteCaps, false, "Ignores hard coded level based haste caps.")
RULE_BOOL(Character, EnableRaidEXPModifier, true, "Enable or disable the raid experience modifier, default is true")
RULE_BOOL(Character, EnableRaidMemberEXPModifier, true, "Enable or disable the raid experience modifier based on members in raid, default is true")
RULE_BOOL(Character, LeaveCursorMoneyOnCorpse, false, "Enable or disable leaving cursor money on player corpses")
RULE_CATEGORY_END()

RULE_CATEGORY(Mercs)
Expand Down
20 changes: 19 additions & 1 deletion zone/corpse.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -395,11 +395,29 @@ Corpse::Corpse(Client* client, int32 in_rezexp) : Mob (
!RuleB(Character, RespawnFromHover) ||
client->ClientVersion() < EQ::versions::ClientVersion::SoF
) {
SetCash(pp->copper, pp->silver, pp->gold, pp->platinum);
auto corpse_copper = pp->copper;
auto corpse_silver = pp->silver;
auto corpse_gold = pp->gold;
auto corpse_platinum = pp->platinum;

pp->copper = 0;
pp->silver = 0;
pp->gold = 0;
pp->platinum = 0;

if (RuleB(Character, LeaveCursorMoneyOnCorpse)) {
corpse_copper += pp->copper_cursor;
corpse_silver += pp->silver_cursor;
corpse_gold += pp->gold_cursor;
corpse_platinum += pp->platinum_cursor;

pp->copper_cursor = 0;
pp->silver_cursor = 0;
pp->gold_cursor = 0;
pp->platinum_cursor = 0;
}

SetCash(corpse_copper, corpse_silver, corpse_gold, corpse_platinum);
}

// get their tints
Expand Down

0 comments on commit 5ae3921

Please sign in to comment.