Skip to content
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

Merged
merged 9 commits into from
Mar 18, 2022

Conversation

GAMMACASE
Copy link
Contributor

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.

Also changes the way event abuses are fixed
Also few minor optimisations to the code
@GAMMACASE
Copy link
Contributor Author

GAMMACASE commented Feb 16, 2022

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 shavit_misc_resettargetname and shavit_misc_resetclassnam and other related cvars, as it's done automatically and does work as expected on maps that do not have the reset triggers in place (bhop_solitude as an example) and also on maps that have their own reset triggers (as the events are applied after the plugin targetname/classname reset)

@rtldg
Copy link
Collaborator

rtldg commented Feb 17, 2022

bhop_overthinker's bonus is back to being abusable. Restarting on bhop_japan is back to sucking. Restarting on bhop_drop is back to sucking, although that map also sucks with eventqueuefix because OnStartTouch boosters are iffy with eventqueuefix. Restarting on bhop_crash_egypt is back to sucking. Restarting on bhop_shutdown is back to sucking. Restarting on bhop_space is back to sucking. Restarting on bhop_interloper is really really awful, although I'm not sure if that needed something in the mapfixes. Restarting on bhop_apathy is sucks although mapfixes didn't have anything for that before either.

I think there's some more but I'm kind of done checking for now. Let me know if you resolve those

@Nairdaa
Copy link
Contributor

Nairdaa commented Feb 17, 2022

touché

@rtldg
Copy link
Collaborator

rtldg commented Feb 19, 2022

rename shavit_misc_resettargetname to something like shavit_misc_resettargetnamexx so the new default value propagates. resolve the branch conflicts (if that option shows up for you). i'll test more soon

@GAMMACASE
Copy link
Contributor Author

rename shavit_misc_resettargetname to something like shavit_misc_resettargetnamexx so the new default value propagates. resolve the branch conflicts (if that option shows up for you). i'll test more soon

I thought about it quite a while, and even thought on completely removing the cvar shavit_misc_resettargetname completely, but on the other hand having it on 1 would just make some maps that are still not found (like crash_egypt) to be non playable (which would be noticed right away and I assume reported instantly) and that's all that there would be (as if the map has the reset trigger on spawn, the targetname and classname from it would be still applied after the timer reset is done). Also was thinking on changing the shavit_misc_resettargetname_main, etc to some non default value by default, so it would help with some maps and eliminate their existence in the mapfixes config (bhop_crash_egypt, bhop_apathy, bhop_interlopper, bhop_space, maybe others too), and leave only a couple that actually needs a mapfix (the ones that require some specific targetname or classname to be set, bhop_drop (although that map could be fixed by using !addspawn in the trigger above the start), bhop_shutdown, etc), but that might need a cvar renaming tho.

@Nairdaa
Copy link
Contributor

Nairdaa commented Feb 19, 2022

updated both shavit-misc and shavit-mapfixes
shavit_misc_resettargetname is set to 0.

Tested CSS: (should work on CSGO as well lol, doesn't matter I believe.)

  • bhop_japan works
  • bhop_crash_egypt works
  • bhop_drop works
  • bhop_shutdown works
  • bhop_interloper is still awkward because of that shit overlay TinyBanana added. Altho, once that overlay ends, map works as intended. You can go spec and back to game without having that overlay again. Another entity removal is required I guess.
  • bhop_space works
  • bhop_apathy works, no more dumb spawn
  • bhop_overthinker - sorry, I don't know the shortcut you're talking about.

@GAMMACASE
Copy link
Contributor Author

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()
@GAMMACASE
Copy link
Contributor Author

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.

@rtldg rtldg merged commit 0fee186 into shavitush:master Mar 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants