Fixed null pointer exception when runecrafting without a familiar

This commit is contained in:
randy 2025-04-01 11:58:25 -06:00
parent 415aa512fb
commit 4053fdf43c

View file

@ -26,10 +26,12 @@ class SnowscapePouchListener : InteractionListener {
// Called by the runecraft pulse
fun emptyPouches(player: Player) {
if (amountInInventory(player, Items.PURE_ESSENCE_7936) > 0 || amountInInventory(player, Items.RUNE_ESSENCE_1436) > 0) return
val familiar = player.getFamiliarManager().getFamiliar()
if (familiar.isBurdenBeast() && (familiar as BurdenBeast).getContainer().containsAtLeastOneItem(Items.PURE_ESSENCE_7936)) {
(familiar as BurdenBeast).transfer(Item(Items.PURE_ESSENCE_7936), 99, true)
if (player.getFamiliarManager().hasFamiliar()) {
val familiar = player.getFamiliarManager().getFamiliar()
if (familiar.isBurdenBeast() && (familiar as BurdenBeast).getContainer().containsAtLeastOneItem(Items.PURE_ESSENCE_7936)) {
(familiar as BurdenBeast).transfer(Item(Items.PURE_ESSENCE_7936), 99, true)
}
}
for (pouchId in pouchIds) {