[BUG]: PlayerEvents.Uncuffed does not fire on automatic undisarm (distance, weapon drop, death, etc.)
Before You Report
- [x] I have searched for existing reports of this bug, and this bug report is unique.
Version
1.1.7
Description
PlayerEvents.Uncuffed is only called when a player manually undisarms someone by holding the [E] interaction key (DisarmingHandlers.ServerProcessDisarmMessage). It completely ignores automatic undisarm handled by DisarmedPlayers.cs (e.g. when distance > 90m, cuffer drops weapons, player dies/changes role, or SetDisarmedStatus(null) is called). This causes state desync in plugins tracking disarmed players.
To Reproduce
- Subscribe to
PlayerEvents.Uncuffed. - Cuff a player.
- Walk 90+ meters away until the game engine automatically frees the player (or drop all weapons from the cuffer's inventory).
- Notice that the player is free (
IsDisarmed == false), butPlayerEvents.Uncuffedwas never invoked.
Expected Behavior
PlayerEvents.Uncuffed should fire whenever a player is removed from DisarmedPlayers.Entries. In PlayerUncuffedEventArgs, Player should be nullable (ReferenceHub?) for cases where the uncuff was performed by game mechanics rather than an active player.
Additional Information
In DisarmedPlayers.cs, automatic undisarm happens via Entries.RemoveAt(i) inside Update(), OnRoleChanged, and Inventory.OnItemsModified, none of which invoke PlayerEvents.OnUncuffed.