[Bug Fix] Cursor Coin Upon Death (#3020)

* Update corpse.cpp

* Add rule toggle.

---------

Co-authored-by: Kinglykrab <kinglykrab@gmail.com>
This commit is contained in:
cybernine186 2023-03-04 17:45:42 -05:00 committed by GitHub
parent 6494fbf916
commit be567af70d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 20 additions and 1 deletions

View File

@ -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, 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, 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, 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_END()
RULE_CATEGORY(Mercs) RULE_CATEGORY(Mercs)

View File

@ -395,11 +395,29 @@ Corpse::Corpse(Client* client, int32 in_rezexp) : Mob (
!RuleB(Character, RespawnFromHover) || !RuleB(Character, RespawnFromHover) ||
client->ClientVersion() < EQ::versions::ClientVersion::SoF 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->copper = 0;
pp->silver = 0; pp->silver = 0;
pp->gold = 0; pp->gold = 0;
pp->platinum = 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 // get their tints