From 2f6a65012fff10fe74d0cf0d51fa189211233f79 Mon Sep 17 00:00:00 2001 From: ceikry Date: Fri, 13 Aug 2021 07:49:57 -0500 Subject: [PATCH] Poisoning items without free inventory space should no longer nuke the product from existence --- .../game/interaction/item/withitem/PoisonWeaponPlugin.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Server/src/main/java/core/game/interaction/item/withitem/PoisonWeaponPlugin.java b/Server/src/main/java/core/game/interaction/item/withitem/PoisonWeaponPlugin.java index 09b3e0af6..03c8203ff 100644 --- a/Server/src/main/java/core/game/interaction/item/withitem/PoisonWeaponPlugin.java +++ b/Server/src/main/java/core/game/interaction/item/withitem/PoisonWeaponPlugin.java @@ -1,5 +1,6 @@ package core.game.interaction.item.withitem; +import api.ContentAPI; import core.game.interaction.NodeUsageEvent; import core.game.interaction.UseWithHandler; import core.game.node.entity.player.Player; @@ -7,6 +8,7 @@ import core.game.node.item.Item; import core.game.world.update.flag.context.Animation; import core.plugin.Initializable; import core.plugin.Plugin; +import org.rs09.consts.Items; /** * Handles weapon poisiong. @@ -297,8 +299,8 @@ public class PoisonWeaponPlugin extends UseWithHandler { } int amt = Math.min(weaponItem.getAmount(), 5); player.getInventory().remove(new Item(weaponItem.getId(), amt)); - player.getInventory().add(new Item(229, 1)); - player.getInventory().add(new Item(product, amt)); + ContentAPI.addItemOrDrop(player, product, amt); + ContentAPI.addItemOrDrop(player, Items.VIAL_229, 1); player.getPacketDispatch().sendMessage("You poison the " + weaponItem.getName().toLowerCase() + "."); }