Core/Loot: Re-fix structure of SMSG_LOOT_MONEY_NOTIFY

This commit is contained in:
Nay
2012-09-11 01:40:58 +01:00
parent f236db6b26
commit b075d8cca7

View File

@@ -182,19 +182,13 @@ void WorldSession::HandleLootMoneyOpcode(WorldPacket& /*recvData*/)
(*i)->ModifyMoney(goldPerPlayer);
(*i)->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_LOOT_MONEY, goldPerPlayer);
uint32 guildGold = 0;
if (Guild* guild = sGuildMgr->GetGuildById((*i)->GetGuildId()))
{
guildGold = CalculatePctN(goldPerPlayer, (*i)->GetTotalAuraModifier(SPELL_AURA_DEPOSIT_BONUS_MONEY_IN_GUILD_BANK_ON_LOOT));
if (guildGold)
if (uint32 guildGold = CalculatePctN(goldPerPlayer, (*i)->GetTotalAuraModifier(SPELL_AURA_DEPOSIT_BONUS_MONEY_IN_GUILD_BANK_ON_LOOT)))
guild->HandleMemberDepositMoney(this, guildGold, true);
}
WorldPacket data(SMSG_LOOT_MONEY_NOTIFY, 4 + 1);
data << uint32(goldPerPlayer);
data << uint8(playersNear.size() > 1 ? 0 : 1); // Controls the text displayed in chat. 0 is "Your share is..." and 1 is "You loot..."
data << uint32(guildGold);
data << uint8(playersNear.size() <= 1); // Controls the text displayed in chat. 0 is "Your share is..." and 1 is "You loot..."
(*i)->GetSession()->SendPacket(&data);
}
}
@@ -203,19 +197,13 @@ void WorldSession::HandleLootMoneyOpcode(WorldPacket& /*recvData*/)
player->ModifyMoney(loot->gold);
player->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_LOOT_MONEY, loot->gold);
uint32 guildGold = 0;
if (Guild* guild = sGuildMgr->GetGuildById(player->GetGuildId()))
{
guildGold = CalculatePctN(loot->gold, player->GetTotalAuraModifier(SPELL_AURA_DEPOSIT_BONUS_MONEY_IN_GUILD_BANK_ON_LOOT));
if (guildGold)
if (uint32 guildGold = CalculatePctN(loot->gold, player->GetTotalAuraModifier(SPELL_AURA_DEPOSIT_BONUS_MONEY_IN_GUILD_BANK_ON_LOOT)))
guild->HandleMemberDepositMoney(this, guildGold, true);
}
WorldPacket data(SMSG_LOOT_MONEY_NOTIFY, 4 + 1);
data << uint32(loot->gold);
data << uint8(1); // "You loot..."
data << uint32(guildGold);
SendPacket(&data);
}