-
Notifications
You must be signed in to change notification settings - Fork 94
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Change the behaviour of shavit_misc_resettargetname #1123
Conversation
Also changes the way event abuses are fixed
Also few minor optimisations to the code
With the latest commit I've added the targetname/classname reset is being performed before the OnStartTouch events are applied from the triggers in a start zone, thus eliminating the whole need in |
I think there's some more but I'm kind of done checking for now. Let me know if you resolve those |
touché |
rename |
I thought about it quite a while, and even thought on completely removing the cvar |
updated both shavit-misc and shavit-mapfixes Tested CSS: (should work on CSGO as well lol, doesn't matter I believe.)
|
Alright, decided not to remove the cvar and currently ended up just renaming it. Anyway that's a minor stuff and could be changed whenever. |
Also replaces PhysicsCheckForEntityUntouch() function call with PhysicsRemoveTouchedList()
Moved the original code to shavit-zones instead as there were some cases where you spawn not on the ground and thus causing the reset code not to be run, now shouldn't be the problem. Also replaced PhysicsCheckForEntityUntouch() function call with PhysicsRemoveTouchedList() (with the additional gamedata that was tested on both lin and win in CSGO and CSS (tf2 one looks very close in the assembly to CSS so I assume it should be fine)) as the PhysicsCheckForEntityUntouch() function wasn't working as expected when start zone Touch call wasn't the latest in the sequence of all the trigger Touch calls. |
This change sets
shavit_misc_resettargetname
to 0 being default. Also does changes how events are handled when player is teleported from outside the start zone. This implementation accounts for the OnStartTouch events that might be in the start zone triggers and wont clear these events out.Main logic behind the implementation is that events are applied at the same tick after teleport from both the trigger that was teleported from (OnEndTouch) and to the destination trigger (OnStartTouch), but they are applied too late for the Shavit_OnStartPre() forward to catch them, thus to clearly erase all events from the OnEndTouch DoPhysicsUntouch() called (forcing events to be applied) and events are cleared right after (This is done for 2 ticks after the teleport was done outside the start zone, this value is fine tuned and was fine in my tests, although I'm not sure if client hacks could delay the packets and cause the difference between ticks here for more than 2, I wasn't successful at it with built in net_* commands or trying to lag the client via snd_restart). After the DoPhysicsUntouch() is called and all the events are cleared for the last time (after 2 ticks), the new OnStartTouch would be triggered for the start zone triggers which after they would apply the expected events.