If a player has a zero balance of RP, they can still purchase trees. The RP balance will go negative and they can buy forever. For instance, if you have 0 RP and a tree costs 250 RP, you can buy the tree and you'll have -250 RP left.
Here's how to duplicate:
1. Player must exist in the ServerRewards data file (playerdata.json)
2. Player has 0 RP
3. Player purchases tree for more than 0 RP
4. The player's RP balance goes negative
Keep in mind, if the player trying to duplicate this is not yet listed in the ServerRewards data file, trying to purchase a tree will result in the Message.Balance language file response you'd expect. However, if you are listed in the data file, you can purchase without receiving that message.
Purchasing trees can cause RP balance to go negative when zero balanceBug
Any chance this could be addressed? Unfortunately it creates a bit of an issue where players are able to purchase trees when they shouldn't be able to.
Here is my quick fix for ServerRewards:
On line: 370
Replace this:
if (_config.UseServerRewards && ServerRewards != null)
return ServerRewards.Call<object>("TakePoints", player.userID, treeCost) != null;With this:
if (_config.UseServerRewards && ServerRewards != null)
{
int points = Convert.ToInt32(ServerRewards?.Call("CheckPoints", player.userID));
if (points >= treeCost)
return ServerRewards.Call<object>("TakePoints", player.userID, treeCost) != null;
else
return false;
}