opentibiabr / canary

Canary Server 13.x for OpenTibia community.
https://docs.opentibiabr.com/
GNU General Public License v2.0
374 stars 619 forks source link

GameStore Tibia Coins Error #2071

Closed luancolombo closed 8 months ago

luancolombo commented 10 months ago

Priority

High

Area

What happened?

Assim como mostra na image, depois dos merges da ultima semana, todos os tibia coins que um personagem tiver, estão aparecendo apenas como transferable, e os tibia coins estão zerados como mostra na imagem. gamestoreerror

What OS are you seeing the problem on?

Linux, Windows

Code of Conduct

dguprado commented 9 months ago

Pude reproduzir o mesmo erro aqui.

GalaxyCLDev commented 9 months ago

Estou com o mesmo problema, espero que resolvam

sebbesiren commented 9 months ago

It isnt possible to use transferable coins in the shop either. I have had to move all coins to personal coins in account database. Then the coins are usable in the shop again.

sebbesiren commented 9 months ago

In the gamestore/init.lua I have found this code:

local offerCoinType = offer.coinType if offer.type == GameStore.OfferTypes.OFFER_TYPE_NAMECHANGE and player:kv():get("namelock") then offerPrice = 0 end -- Check if offer can be honored if offerPrice > 0 and not player:canPayForOffer(offerPrice, offerCoinType) then return queueSendStoreAlertToUser("You don't have enough coins. Your purchase has been cancelled.", 250, playerId) end

That calls this function:

`function Player.canPayForOffer(self, coinsToRemove, coinType) -- Check if the player has the required amount of regular coins and the offer type is regular. if coinType == GameStore.CoinType.Coin then return self:canRemoveCoins(coinsToRemove) end

-- Check if the player has the required amount of transferable coins and the offer type is transferable.
if coinType == GameStore.CoinType.Transferable then
    return self:canRemoveTransferableCoins(coinsToRemove)
end

return false

end`

My hunch is that coinType is GameStore.CoinType.Coin only 🤔