Option to disable Crawling in Cvar (#39739)
This commit is contained in:
@@ -56,4 +56,12 @@ public sealed partial class CCVars
|
|||||||
[CVarControl(AdminFlags.VarEdit)]
|
[CVarControl(AdminFlags.VarEdit)]
|
||||||
public static readonly CVarDef<float> MovementPushMassCap =
|
public static readonly CVarDef<float> MovementPushMassCap =
|
||||||
CVarDef.Create("movement.push_mass_cap", 1.75f, CVar.SERVER | CVar.REPLICATED);
|
CVarDef.Create("movement.push_mass_cap", 1.75f, CVar.SERVER | CVar.REPLICATED);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Is crawling enabled
|
||||||
|
/// </summary>
|
||||||
|
[CVarControl(AdminFlags.VarEdit)]
|
||||||
|
public static readonly CVarDef<bool> MovementCrawling =
|
||||||
|
CVarDef.Create("movement.crawling", true, CVar.SERVER | CVar.REPLICATED);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
using Content.Shared.Alert;
|
using Content.Shared.Alert;
|
||||||
using Content.Shared.Buckle.Components;
|
using Content.Shared.Buckle.Components;
|
||||||
|
using Content.Shared.CCVar;
|
||||||
using Content.Shared.Damage;
|
using Content.Shared.Damage;
|
||||||
using Content.Shared.Damage.Components;
|
using Content.Shared.Damage.Components;
|
||||||
using Content.Shared.Database;
|
using Content.Shared.Database;
|
||||||
@@ -13,6 +14,7 @@ using Content.Shared.Popups;
|
|||||||
using Content.Shared.Rejuvenate;
|
using Content.Shared.Rejuvenate;
|
||||||
using Content.Shared.Standing;
|
using Content.Shared.Standing;
|
||||||
using Robust.Shared.Audio;
|
using Robust.Shared.Audio;
|
||||||
|
using Robust.Shared.Configuration;
|
||||||
using Robust.Shared.Input.Binding;
|
using Robust.Shared.Input.Binding;
|
||||||
using Robust.Shared.Physics;
|
using Robust.Shared.Physics;
|
||||||
using Robust.Shared.Physics.Systems;
|
using Robust.Shared.Physics.Systems;
|
||||||
@@ -33,6 +35,7 @@ public abstract partial class SharedStunSystem
|
|||||||
[Dependency] private readonly SharedPopupSystem _popup = default!;
|
[Dependency] private readonly SharedPopupSystem _popup = default!;
|
||||||
[Dependency] private readonly SharedPhysicsSystem _physics = default!;
|
[Dependency] private readonly SharedPhysicsSystem _physics = default!;
|
||||||
[Dependency] private readonly StandingStateSystem _standingState = default!;
|
[Dependency] private readonly StandingStateSystem _standingState = default!;
|
||||||
|
[Dependency] private readonly IConfigurationManager _cfgManager = default!;
|
||||||
|
|
||||||
public static readonly ProtoId<AlertPrototype> KnockdownAlert = "Knockdown";
|
public static readonly ProtoId<AlertPrototype> KnockdownAlert = "Knockdown";
|
||||||
|
|
||||||
@@ -238,7 +241,7 @@ public abstract partial class SharedStunSystem
|
|||||||
private void ToggleKnockdown(Entity<CrawlerComponent?, KnockedDownComponent?> entity)
|
private void ToggleKnockdown(Entity<CrawlerComponent?, KnockedDownComponent?> entity)
|
||||||
{
|
{
|
||||||
// We resolve here instead of using TryCrawling to be extra sure someone without crawler can't stand up early.
|
// We resolve here instead of using TryCrawling to be extra sure someone without crawler can't stand up early.
|
||||||
if (!Resolve(entity, ref entity.Comp1, false))
|
if (!Resolve(entity, ref entity.Comp1, false) || !_cfgManager.GetCVar(CCVars.MovementCrawling))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!Resolve(entity, ref entity.Comp2, false))
|
if (!Resolve(entity, ref entity.Comp2, false))
|
||||||
@@ -263,7 +266,7 @@ public abstract partial class SharedStunSystem
|
|||||||
if (!KnockdownOver((entity, entity.Comp)))
|
if (!KnockdownOver((entity, entity.Comp)))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (!_crawlerQuery.TryComp(entity, out var crawler))
|
if (!_crawlerQuery.TryComp(entity, out var crawler) || !_cfgManager.GetCVar(CCVars.MovementCrawling))
|
||||||
{
|
{
|
||||||
// If we can't crawl then just have us sit back up...
|
// If we can't crawl then just have us sit back up...
|
||||||
// In case you're wondering, the KnockdownOverCheck, returns if we're able to move, so if next update is null.
|
// In case you're wondering, the KnockdownOverCheck, returns if we're able to move, so if next update is null.
|
||||||
|
|||||||
Reference in New Issue
Block a user