Fixed mining gem random reward logic to actually drop the gem if player inventory is full

This commit is contained in:
Byte 2022-09-17 04:33:53 +00:00 committed by Ryan
parent 5c4134e2e3
commit 135dcb136c

View file

@ -189,9 +189,10 @@ class MiningSkillPulse(private val player: Player, private val node: Node) : Pul
if (RandomFunction.roll(chance)) { if (RandomFunction.roll(chance)) {
val gem = GEM_REWARDS.random() val gem = GEM_REWARDS.random()
sendMessage(player,"You find a ${gem.name}!") sendMessage(player,"You find a ${gem.name}!")
if (!addItem(player, gem.id)) { if (freeSlots(player) == 0) {
sendMessage(player,"You do not have enough space in your inventory, so you drop the gem on the floor.") sendMessage(player,"You do not have enough space in your inventory, so you drop the gem on the floor.")
} }
addItemOrDrop(player, gem.id)
} }
} }