Compare commits
2 commits
f69bff1cfa
...
a457162439
| Author | SHA1 | Date | |
|---|---|---|---|
| a457162439 | |||
|
|
d114e665be |
1 changed files with 8 additions and 2 deletions
|
|
@ -5,6 +5,9 @@
|
|||
|
||||
void GuildFunds::OnLootMoney(Player* player, uint32 gold)
|
||||
{
|
||||
if (LootMultiplier < 1)
|
||||
return;
|
||||
|
||||
if (Group* group = player->GetGroup())
|
||||
{
|
||||
uint32 membersInRange = 0;
|
||||
|
|
@ -17,7 +20,10 @@ void GuildFunds::OnLootMoney(Player* player, uint32 gold)
|
|||
}
|
||||
}
|
||||
|
||||
if (LootMultiplier < 1)
|
||||
// Guard the division. In practice the looter counts themselves, but a group whose
|
||||
// members all fail the distance check would divide by zero and take worldserver
|
||||
// down with SIGFPE.
|
||||
if (!membersInRange)
|
||||
return;
|
||||
|
||||
uint32 money = (gold / membersInRange) * LootMultiplier / 100;
|
||||
|
|
@ -49,7 +55,7 @@ void GuildFunds::OnLootMoney(Player* player, uint32 gold)
|
|||
{
|
||||
uint32 money = gold * LootMultiplier / 100;
|
||||
|
||||
if (money < 1 || LootMultiplier < 1)
|
||||
if (money < 1)
|
||||
return;
|
||||
|
||||
guild->HandleMemberDepositMoney(player->GetSession(), money);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue