Skip to content

Commit

Permalink
Deprecate multiple fixes that vanilla game has fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
agrastiOs committed Mar 7, 2024
1 parent bc08f76 commit c4ce7ff
Show file tree
Hide file tree
Showing 6 changed files with 1 addition and 166 deletions.
24 changes: 1 addition & 23 deletions INTERNALS.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,33 +87,11 @@ parameter is set to true. Obviously, this applies to all mediguns, the Quick-Fix
included. The Quick-Fix still benefits from the speed boost while a demoman is
charging.
## Fix Ghost Crossbow Bolts & Projectiles Ignore Teammates
## Fix Projectiles Ignore Teammates
The virtual method `bool CBaseProjectile::CanCollideWithTeammates(*this)`
returns the field `m_bCanCollideWithTeammates` which is initialized to false and
updated to true during `CollideWithTeammatesThink`. `CBaseProjectile::Spawn()`
schedules this `Think` to execute after
`gpGlobals->curtime + GetCollideWithTeammatesDelay()`, the latter returning
250ms by default. The file concerned is `game/shared/baseprojectile.cpp`.
`CTFProjectile_HealingBolt` overrides `GetCollideWithTeammatesDelay` to always
return 0ms, however the projectile obviously doesn't collide with teammates as
soon as it spawns. I believe this behavior to not be expected, the intent seems
to want it collide as soon as possible but it seems that `Think`s are only
precise over a few server ticks.
One could argue that developers were aware of the effects of both methods as
`CTFProjectile_GrapplingHook`, which is just below and shares its mother class
with `CTFProjectile_HealingBolt`, and simply overrides `CanCollideWithTeammates`
to always return false. I don't believe this to be a fair assessment. Grappling
hooks were added later on, and the only way to implement the logic to ignore
teammates would have been by overriding `CanCollideWithTeammates` (or
`CollideWithTeammatesThink`), possibly creating the need for a virtual method
altogether. In this case, as the behaviors are different and as the Crossbow's
current implementation was probably not known to be an issue, it was overlooked
and was not updated. The file concerned is
`game/server/tf/tf_projectile_arrow.cpp`.
On entity creation, we can simply hook this virtual method to always return true
when the classname is `tf_projectile_healing_bolt`, or otherwise false if it
starts with `tf_projectile_`.
25 changes: 0 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,11 @@ these servers. It changes cvars in bulk according to the following:
| | all | fixes | none | asf | etf2l | ozf | rgl |
| ---------------------------------------- | --- | ----- | ---- | --- | ----- | --- | --- |
| sm_empty_active_ubercharges_when_dropped | 1 | 1 | 0 | 0 | 1 | 0 | 0 |
| sm_fix_ghost_crossbow_bolts | 1 | 1 | 0 | 0 | 1 | 1 | 1 |
| sm_fix_post_pause_state | 1 | 1 | 0 | 0 | 1 | 0 | 0 |
| sm_fix_reflect_self_damage | 1 | 1 | 0 | 0 | 0 | 0 | 1 |
| sm_fix_slope_bug | 1 | 1 | 0 | 1 | 1 | 1 | 1 |
| sm_fix_sticky_delay | 1 | 1 | 0 | 0 | 1 | 1 | 1 |
| sm_inhibit_extendfreeze | 1 | 1 | 0 | 0 | 1 | 1 | 1 |
| sm_override_pipe_size | 4.0 | 4.0 | 0 | 0 | 4.0 | 4.0 | 0 |
| sm_projectiles_collide_with_cylinders | 1 | 1 | 0 | 0 | 0 | 0 | 0 |
| sm_projectiles_ignore_teammates | 1 | 1 | 0 | 1 | 1 | 0 | 0 |
| sm_remove_halloween_souls | 1 | 1 | 0 | 0 | 1 | 1 | 1 |
Expand Down Expand Up @@ -56,11 +54,6 @@ _Presets were updated on 2022-05-16._
This prevents the trick of swapping mediguns while ubercharged to conserve
some of the charge.

- **Fix Ghost Crossbow Bolts**

When enabled with `sm_fix_ghost_crossbow_bolts 1`, crossbow bolts will no
longer pass through teammates when in close range.

- **Revert state after unpausing**

When enabled with `sm_fix_post_pause_state 1`, gameplay state that changed
Expand Down Expand Up @@ -88,24 +81,6 @@ _Presets were updated on 2022-05-16._
When enabled with `sm_fix_sticky_delay 1`, stickies will no longer fail to
detonate when swapping weapons.

- **Inhibit `extendfreeze`**

When enabled with `sm_inhibit_extendfreeze 1`, clients will not be able to use
the `extendfreeze` command.
This prevents some information leak, players can use this command after dying
to spectate their killer in third person.

[Demonstration of the info leak in this video](https://youtu.be/WHGVAJgHMX8?t=371)

- **Override Pipe Collider Size**

When enabled with `sm_override_pipe_size [1 .. ]`, all pipes will have their
collider resized to that value in Hammer Units.
The size of official pipes is 4.0, except for Iron Bomber, which is 8.75 wide
and 7.71424 tall.

Credits for implementing go to [@bodolaz146]

- **Projectiles Collide With Cylinder Player Hitboxes**

When enabled with `sm_projectiles_collide_with_cylinders 1`, projectiles will
Expand Down
18 changes: 0 additions & 18 deletions scripting/tf2-comp-fixes.sp
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,13 @@
#include "tf2-comp-fixes/concede.sp"
#include "tf2-comp-fixes/debug.sp"
#include "tf2-comp-fixes/empty-active-ubercharges-when-dropped.sp"
#include "tf2-comp-fixes/fix-ghost-crossbow-bolts.sp"
#include "tf2-comp-fixes/fix-post-pause-state.sp"
#include "tf2-comp-fixes/fix-reflect-self-damage.sp"
#include "tf2-comp-fixes/fix-slope-bug.sp"
#include "tf2-comp-fixes/fix-sticky-delay.sp"
#include "tf2-comp-fixes/ghostify-soldier-statue.sp"
#include "tf2-comp-fixes/grounded-rj-resistance.sp"
#include "tf2-comp-fixes/gunboats-always-apply.sp"
#include "tf2-comp-fixes/inhibit-extendfreeze.sp"
#include "tf2-comp-fixes/override-pipe-size.sp"
#include "tf2-comp-fixes/prevent-respawning.sp"
#include "tf2-comp-fixes/projectiles-collide-with-cylinders.sp"
#include "tf2-comp-fixes/projectiles-ignore-teammates.sp"
Expand Down Expand Up @@ -83,16 +80,13 @@ void OnPluginStart() {
// Here
Concede_Setup();
EmptyActiveUberchargesWhenDropped_Setup(game_config);
FixGhostCrossbowBolts_Setup();
FixPostPauseState_Setup();
FixReflectSelfDamage_Setup(game_config);
FixSlopeBug_Setup(game_config);
FixStickyDelay_Setup(game_config);
GhostifySoldierStatue_Setup();
GroundedRjResistance_Setup(game_config);
GunboatsAlwaysApply_Setup(game_config);
InhibitExtendfreeze_Setup();
OverridePipeSize_Setup(game_config);
PreventRespawning_Setup(game_config);
ProjectilesCollideWithCylinders_Setup(game_config);
ProjectilesIgnoreTeammates_Setup();
Expand Down Expand Up @@ -152,13 +146,10 @@ Action Command_Cf(int client, int args) {
// Here
ReplyToCommand(client, "--- Fixes");
ReplyDiffConVar(client, "sm_empty_active_ubercharges_when_dropped");
ReplyDiffConVar(client, "sm_fix_ghost_crossbow_bolts");
ReplyDiffConVar(client, "sm_fix_post_pause_state");
ReplyDiffConVar(client, "sm_fix_reflect_self_damage");
ReplyDiffConVar(client, "sm_fix_slope_bug");
ReplyDiffConVar(client, "sm_fix_sticky_delay");
ReplyDiffConVar(client, "sm_inhibit_extendfreeze");
ReplyDiffConVar(client, "sm_override_pipe_size");
ReplyDiffConVar(client, "sm_projectiles_collide_with_cylinders");
ReplyDiffConVar(client, "sm_projectiles_ignore_teammates");
ReplyDiffConVar(client, "sm_remove_halloween_souls");
Expand Down Expand Up @@ -207,9 +198,6 @@ Action Command_Cf(int client, int args) {
FindConVar("sm_empty_active_ubercharges_when_dropped")
.SetBool(all || fixes || etf2l);

FindConVar("sm_fix_ghost_crossbow_bolts")
.SetBool(all || fixes || etf2l || ozf || rgl);

FindConVar("sm_fix_post_pause_state")
.SetBool(all || fixes || etf2l);

Expand All @@ -222,12 +210,6 @@ Action Command_Cf(int client, int args) {
FindConVar("sm_fix_sticky_delay")
.SetBool(all || fixes || etf2l || ozf || rgl);

FindConVar("sm_inhibit_extendfreeze")
.SetBool(all || fixes || etf2l || ozf || rgl);

FindConVar("sm_override_pipe_size")
.SetFloat(all || fixes || etf2l || ozf ? 4.0 : 0.0);

FindConVar("sm_projectiles_collide_with_cylinders")
.SetBool(all || fixes);

Expand Down
18 changes: 0 additions & 18 deletions scripting/tf2-comp-fixes/inhibit-extendfreeze.sp

This file was deleted.

79 changes: 0 additions & 79 deletions scripting/tf2-comp-fixes/override-pipe-size.sp

This file was deleted.

3 changes: 0 additions & 3 deletions updatefile.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,13 @@
"Source" "Path_SM/scripting/tf2-comp-fixes/concede.sp"
"Source" "Path_SM/scripting/tf2-comp-fixes/debug.sp"
"Source" "Path_SM/scripting/tf2-comp-fixes/empty-active-ubercharges-when-dropped.sp"
"Source" "Path_SM/scripting/tf2-comp-fixes/fix-ghost-crossbow-bolts.sp"
"Source" "Path_SM/scripting/tf2-comp-fixes/fix-post-pause-state.sp"
"Source" "Path_SM/scripting/tf2-comp-fixes/fix-reflect-self-damage.sp"
"Source" "Path_SM/scripting/tf2-comp-fixes/fix-slope-bug.sp"
"Source" "Path_SM/scripting/tf2-comp-fixes/fix-sticky-delay.sp"
"Source" "Path_SM/scripting/tf2-comp-fixes/ghostify-soldier-statue.sp"
"Source" "Path_SM/scripting/tf2-comp-fixes/grounded-rj-resistance.sp"
"Source" "Path_SM/scripting/tf2-comp-fixes/gunboats-always-apply.sp"
"Source" "Path_SM/scripting/tf2-comp-fixes/inhibit-extendfreeze.sp"
"Source" "Path_SM/scripting/tf2-comp-fixes/override-pipe-size.sp"
"Source" "Path_SM/scripting/tf2-comp-fixes/prevent-respawning.sp"
"Source" "Path_SM/scripting/tf2-comp-fixes/projectiles-collide-with-cylinders.sp"
"Source" "Path_SM/scripting/tf2-comp-fixes/projectiles-ignore-teammates.sp"
Expand Down

0 comments on commit c4ce7ff

Please sign in to comment.