wiremod / advduplicator

Garry's Mod add-on that allows a player to save and load contraptions
http://www.wiremod.com
Apache License 2.0
67 stars 43 forks source link

Stuck loading bar appears when switching to a different tool #91

Open SligWolf opened 1 month ago

SligWolf commented 1 month ago

The ADV Dupe 1 loading bar for ghosting the dupe is still visible when deploying a different tool while having a non-toolgun equiped. It happens in singleplayer and multiplayer.

Do the following to reproduce the error:

  1. Equip the ADV Dupe 1 and copy a prop.
  2. Switch to a weapon or physgun.
  3. Choose a different tool from the Q-Menu. Tool gets deployed.
  4. Loading bar appears and is stuck until ADV Dupe 1 is redeployed.

Here a video that shows the error: https://github.com/wiremod/advduplicator/assets/17761396/93cb45a1-10e5-4da5-b527-8ab9a5c0d454

GMod Version: 2024.03.21 (main branch)

Grocel commented 1 month ago

I noticed that when the tool gun is redeployed from the Q-Menu the previous tool (e.g. the Advanced Duplicator Tool) is active for a short period of time (like for less then 0.1 sec) before switching to the actually selected tool without calling TOOL:Holster() for the previous tool.

This might be a GMod bug. I think to fix the bug the tool should only "Think" if it is actually actively selected and only after TOOL:Deploy() has been called, I think this should be reported to Rubat.