Disable pushing (#6760)

This commit is contained in:
metalgearsloth
2022-03-03 13:32:03 +11:00
committed by GitHub
parent 6116fb3f92
commit 834b2e4d58
2 changed files with 4 additions and 4 deletions

View File

@@ -291,7 +291,7 @@ namespace Content.Shared.CCVar
/// Technically client doesn't need to know about it but this may prevent a bug in the distant future so it stays. /// Technically client doesn't need to know about it but this may prevent a bug in the distant future so it stays.
/// </remarks> /// </remarks>
public static readonly CVarDef<bool> MobPushing = public static readonly CVarDef<bool> MobPushing =
CVarDef.Create("physics.mob_pushing", true, CVar.REPLICATED); CVarDef.Create("physics.mob_pushing", false, CVar.REPLICATED);
/* /*
* Lobby music * Lobby music

View File

@@ -16,7 +16,7 @@ namespace Content.Shared.Movement.EntitySystems
public override void Initialize() public override void Initialize()
{ {
base.Initialize(); base.Initialize();
Get<SharedPhysicsSystem>().KinematicControllerCollision += HandleCollisionMessage; Get<SharedPhysicsSystem>().KinematicControllerCollision += OnMobCollision;
IoCManager.Resolve<IConfigurationManager>().OnValueChanged(CCVars.MobPushing, SetPushing, true); IoCManager.Resolve<IConfigurationManager>().OnValueChanged(CCVars.MobPushing, SetPushing, true);
} }
@@ -29,13 +29,13 @@ namespace Content.Shared.Movement.EntitySystems
{ {
base.Shutdown(); base.Shutdown();
IoCManager.Resolve<IConfigurationManager>().UnsubValueChanged(CCVars.MobPushing, SetPushing); IoCManager.Resolve<IConfigurationManager>().UnsubValueChanged(CCVars.MobPushing, SetPushing);
Get<SharedPhysicsSystem>().KinematicControllerCollision -= HandleCollisionMessage; Get<SharedPhysicsSystem>().KinematicControllerCollision -= OnMobCollision;
} }
/// <summary> /// <summary>
/// Fake pushing for player collisions. /// Fake pushing for player collisions.
/// </summary> /// </summary>
private void HandleCollisionMessage(Fixture ourFixture, Fixture otherFixture, float frameTime, Vector2 worldNormal) private void OnMobCollision(Fixture ourFixture, Fixture otherFixture, float frameTime, Vector2 worldNormal)
{ {
if (!_pushingEnabled) return; if (!_pushingEnabled) return;