Skip to content

Commit

Permalink
Made so buy house and buy premy commands use removeTotalMoney function (
Browse files Browse the repository at this point in the history
#3092)

Instead of using only the inventory money it will use both inventory and bank money, just like everything else: npcs, market and so on.
  • Loading branch information
EPuncker committed Jun 23, 2020
1 parent 95dcffd commit cad4cb0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion data/talkactions/scripts/buyhouse.lua
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ function onSay(player, words, param)
end

local price = house:getTileCount() * housePrice
if not player:removeMoney(price) then
if not player:removeTotalMoney(price) then
player:sendCancelMessage("You do not have enough money.")
return false
end
Expand Down
2 changes: 1 addition & 1 deletion data/talkactions/scripts/buyprem.lua
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ function onSay(player, words, param)
end

if player:getPremiumDays() <= config.maxDays then
if player:removeMoney(config.price) then
if player:removeTotalMoney(config.price) then
player:addPremiumDays(config.days)
player:sendTextMessage(MESSAGE_INFO_DESCR, "You have bought " .. config.days .." days of premium account.")
else
Expand Down

0 comments on commit cad4cb0

Please sign in to comment.