Flashkirby / WeaponOut

tModloader mod, for showing weapons held, and other misc. features
https://forums.terraria.org/index.php?threads/weaponout.47130/
12 stars 7 forks source link

Dupe glitch when dropping items #8

Closed 239042384923 closed 6 years ago

239042384923 commented 6 years ago

In multiplayer servers, modded items will have their UseItem() function called when the item is dropped via right clicking outside the inventory window. At first I thought this was a bug in tModLoader itself, but it only happens if WeaponOut is enabled. If it's disabled, then the problem goes away.

To reproduce: 1) Load the ExampleMod from tModLoader and the WeaponOut mod 2) Start a multiplayer server (can be a listen server or a dedicated server, it doesn't matter) 3) Get the test Plantera Item 4) In your inventory screen, pick up the item, then drop it by right clicking out in the open

Expected behavior: The item should not be consumed, and Plantera will not be summoned

Actual behavior: The item is not consumed, but Plantera is summoned! This is basically a dupe glitch, as one PlanteraItem can be used infinitely by dropping it.

Misc notes: -This glitch can only occur with modded items. Vanilla items will NOT be glitched. -Consumable items are not affected by this glitch, so players can't drink the same potion infinitely. The most notable use for this glitch is boss or invasion summoning items. -This is also reproducible for other mods with boss summoning items, for instance the Calamity mod's Desert Scourge boss.