Fixed "At Gold Limit" popping every time you are gold capped and buy any item (with extended costs)
--HG-- branch : trunk
This commit is contained in:
@@ -1439,11 +1439,19 @@ class Player : public Unit, public GridObject<Player>
|
|||||||
if (d < 0)
|
if (d < 0)
|
||||||
SetMoney (GetMoney() > uint32(-d) ? GetMoney() + d : 0);
|
SetMoney (GetMoney() > uint32(-d) ? GetMoney() + d : 0);
|
||||||
else
|
else
|
||||||
SetMoney (GetMoney() < uint32(MAX_MONEY_AMOUNT - d) ? GetMoney() + d : MAX_MONEY_AMOUNT);
|
{
|
||||||
|
uint32 newAmount = 0;
|
||||||
|
if (GetMoney() < uint32(MAX_MONEY_AMOUNT - d))
|
||||||
|
newAmount = GetMoney() + d;
|
||||||
|
else
|
||||||
|
{
|
||||||
// "At Gold Limit"
|
// "At Gold Limit"
|
||||||
if (GetMoney() >= MAX_MONEY_AMOUNT)
|
newAmount = MAX_MONEY_AMOUNT;
|
||||||
SendEquipError(EQUIP_ERR_TOO_MUCH_GOLD,NULL,NULL);
|
if (d)
|
||||||
|
SendEquipError(EQUIP_ERR_TOO_MUCH_GOLD, NULL, NULL);
|
||||||
|
}
|
||||||
|
SetMoney (newAmount);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
void SetMoney(uint32 value)
|
void SetMoney(uint32 value)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user