mirror of
https://github.com/EQEmu/Server.git
synced 2026-11-22 20:17:16 +00:00
[Bug Fix] Take the platinum before granting guild favor for a donation (#5142)
This commit is contained in:
1 parent
33d1d0385c
commit
38ba1eeed3
1 file changed
+4
-1
@@ -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)) {
|
||||||
|
|||||||
Reference in new issue
Block a user