Skip to content

Commit

Permalink
Fix duplicate item on picking up an unprimed grenade
Browse files Browse the repository at this point in the history
  • Loading branch information
DeltaHelios committed Jul 24, 2024
1 parent 527f3d8 commit 980ac86
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ public ActionResult interact(PlayerEntity player, Hand hand)
{
if (!isPrimed() && age > MIN_PICKUP_AGE && player.getInventory().getMainHandStack().isEmpty())
{
player.giveItemStack(new ItemStack(SwgItems.Explosives.FragmentationGrenade));

if (getWorld() instanceof ServerWorld)
player.giveItemStack(new ItemStack(SwgItems.Explosives.FragmentationGrenade));
this.discard();
}
return super.interact(player, hand);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,8 @@ public ActionResult interact(PlayerEntity player, Hand hand)
{
if (!isPrimed() && age > MIN_PICKUP_AGE && player.getInventory().getMainHandStack().isEmpty())
{
player.giveItemStack(new ItemStack(SwgItems.Explosives.ThermalDetonator));

if (getWorld() instanceof ServerWorld)
player.giveItemStack(new ItemStack(SwgItems.Explosives.ThermalDetonator));
this.discard();
}
return super.interact(player, hand);
Expand Down

0 comments on commit 980ac86

Please sign in to comment.