Open mgetJane opened 1 month ago
This sounds like a duplicate of https://github.com/Facepunch/garrysmod-requests/issues/894
one of my use cases is accumulating shotgun pellet hits so i can send them all in one go for clientside hitreg
using timer.Simple would add a relatively considerable delay to this for my purposes so i had to resort to doing this mess:
hook.Add("SetupMove", "CLHR_SendToServer", s2s)
hook.Add("StartCommand", "CLHR_SendToServer", s2s)
hook.Add("CreateMove", "CLHR_SendToServer", s2s)
hook.Add("PreRender", "CLHR_SendToServer", s2s)
hook.Add("Think", "CLHR_SendToServer", s2s)
(clientside, whichever one of these will get executed first is just random)
This sounds like a duplicate of #894
that one is only serverside and seems to be tied to physics (though still might be a good place to execute stuff at the end of a tick?)
basically should just run at the end of the current tick/frame instead of at the start of the next tick (specifically right before GM:Tick) like
timer.Simple(0, function() end)
doescould be called something like
Defer(function() end)
the main difference is that it would execute the function before any further simulation happens and without the 1-tick delay in real time
also, using a zero-second timer.Simple is such a common pattern in gmod coding and its uses only very occasionally actually require a 1-tick delay, it would be better if we had a more intentioned function instead of practically jury-rigging with timers for this purpose