[Bug Fix] Take the platinum before granting guild favor for a donation (#5142)
Build / Linux (push) Canceled after 0s
Build / Windows (push) Canceled after 0s

This commit is contained in:
straps-eq authored and GitHub committed 2026-11-14 00:03:59 -08:00
1 parent 33d1d0385c
commit 38ba1eeed3
1 file changed
+4 -1
+4 -1
View File
@@ -17202,11 +17202,14 @@ void Client::Handle_OP_GuildTributeDonatePlat(const EQApplicationPacket *app)
auto favor = quantity * RuleI(Guild, TributePlatConversionRate); auto favor = quantity * RuleI(Guild, TributePlatConversionRate);
auto guild = guild_mgr.GetGuildByGuildID(guild_id); auto guild = guild_mgr.GetGuildByGuildID(guild_id);
if (guild) { if (guild) {
if (quantity == 0 || !TakePlatinum(quantity, false)) {
return;
}
guild->tribute.favor += favor; guild->tribute.favor += favor;
guild_mgr.UpdateDbGuildFavor(GuildID(), guild->tribute.favor); guild_mgr.UpdateDbGuildFavor(GuildID(), guild->tribute.favor);
auto member_favor = guild_mgr.UpdateDbMemberFavor(GuildID(), CharacterID(), favor); auto member_favor = guild_mgr.UpdateDbMemberFavor(GuildID(), CharacterID(), favor);
TakePlatinum(quantity, false);
SendGuildTributeDonatePlatReply(in, favor); SendGuildTributeDonatePlatReply(in, favor);
if(PlayerEventLogs::Instance()->IsEventEnabled(PlayerEvent::GUILD_TRIBUTE_DONATE_PLAT)) { if(PlayerEventLogs::Instance()->IsEventEnabled(PlayerEvent::GUILD_TRIBUTE_DONATE_PLAT)) {