[TF2] Fix Lightning Ball Spell constantly phasing players in and out of Purgatory#1846
Open
Piogre wants to merge 1 commit intoValveSoftware:masterfrom
Open
[TF2] Fix Lightning Ball Spell constantly phasing players in and out of Purgatory#1846Piogre wants to merge 1 commit intoValveSoftware:masterfrom
Piogre wants to merge 1 commit intoValveSoftware:masterfrom
Conversation
… entities Lightning Ball spell currently uses the Teleport function passing only a velocity vector. Mechanically this just sets the player's absolute velocity, but invokes teleportation-related side-effects including apparently retriggering any trigger_add_tf_player_condition which the player is already inside of (and possibly others) causing in particular a noticeable issue if the player is inside a purgatory condition trigger. Since lightning ball doesn't actually need to set anything other than the player's velocity, it can just call the velocity-setting functions that teleport calls directly to avoid the side-effects with no change in movement mechanics
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Currently, a player hit with the Lightning Ball spell while in Purgatory will repeatedly gain and lose the TF_COND_PURGATORY condition for as long as they're in the spell's effective radius, which will cause them to stay ubered and kritzed for the duration, while the whole server is constantly spammed with the "escaped the underworld" chat alert and bell sound.
This is because the lightning ball spell calls the "teleport" function on players inside its radius, passing only a velocity vector, to continually re-apply an absolute velocity and draw those players toward its center. Mechanically, it's only setting velocity on the player, but because it's technically teleporting them it has other side effects, including apparently re-triggering trigger_add_tf_player_condition entities they're inside of and thus removing/re-applying the condition. This is noticeable for the TF_COND_PURGATORY condition, which applies the uber, kritz, server-wide sound alert and chat alert upon its removal.
Having the Lightning Ball spell set the velocity directly instead of unnecessarily teleporting the player (calling the same functions teleport would call for velocity) fixes this issue.
See below demonstration on pd_pit_of_death_event (sound on).
lightning.mp4
edit: fixes ValveSoftware/Source-1-Games#4492