Open DBotThePony opened 4 years ago
This is done by GMod on purpose, but I don't know what it was trying to solve. The comment is "debounce the use key", but I can't find any scenario where there are problems without this code.
Actually this is done on purpose in base Half Life 2 as well.
Sounds like it should be removed and restored before the item's Use is called were this to be fixed, but I don't even think that's necessary as item's don't manually check IN_USE.
But it does work as expected on clientside.
Steps to reproduce:
hook.Add('Move', 'testkeypressed', function(self, cmovedata) if cmovedata:KeyPressed(IN_USE) then print('Ding! Move', CurTime(), IsFirstTimePredicted()) end end)
Ding! SetupMove 2679.8100585938 true Ding! Move 2679.8100585938 true Ding! SetupMove 2679.8100585938 false Ding! Move 2679.8100585938 false
Ding! SetupMove 2794.8298339844 true Ding! Move 2794.8298339844 true Ding! SetupMove 2794.8298339844 false Ding! Move 2794.8298339844 false