mirror of
https://github.com/DeltaV-Station/Delta-v.git
synced 2026-09-29 23:57:29 +00:00
* Use new Subs.CVar helper
Removes manual config OnValueChanged calls, removes need to remember to manually unsubscribe.
This both reduces boilerplate and fixes many issues where subscriptions weren't removed on entity system shutdown.
* Fix a bunch of warnings
* More warning fixes
* Use new DateTime serializer to get rid of ISerializationHooks in changelog code.
* Get rid of some more ISerializationHooks for enums
* And a little more
* Apply suggestions from code review
Co-authored-by: 0x6273 <0x40@keemail.me>
---------
Co-authored-by: 0x6273 <0x40@keemail.me>
(cherry picked from commit 68ce53ae17)
28 lines
1.3 KiB
C#
28 lines
1.3 KiB
C#
using Content.Shared.CCVar;
|
|
|
|
namespace Content.Server.Explosion.EntitySystems;
|
|
|
|
public sealed partial class ExplosionSystem : EntitySystem
|
|
{
|
|
public int MaxIterations { get; private set; }
|
|
public int MaxArea { get; private set; }
|
|
public float MaxProcessingTime { get; private set; }
|
|
public int TilesPerTick { get; private set; }
|
|
public int ThrowLimit { get; private set; }
|
|
public bool SleepNodeSys { get; private set; }
|
|
public bool IncrementalTileBreaking { get; private set; }
|
|
public int SingleTickAreaLimit {get; private set; }
|
|
|
|
private void SubscribeCvars()
|
|
{
|
|
Subs.CVar(_cfg, CCVars.ExplosionTilesPerTick, value => TilesPerTick = value, true);
|
|
Subs.CVar(_cfg, CCVars.ExplosionThrowLimit, value => ThrowLimit = value, true);
|
|
Subs.CVar(_cfg, CCVars.ExplosionSleepNodeSys, value => SleepNodeSys = value, true);
|
|
Subs.CVar(_cfg, CCVars.ExplosionMaxArea, value => MaxArea = value, true);
|
|
Subs.CVar(_cfg, CCVars.ExplosionMaxIterations, value => MaxIterations = value, true);
|
|
Subs.CVar(_cfg, CCVars.ExplosionMaxProcessingTime, value => MaxProcessingTime = value, true);
|
|
Subs.CVar(_cfg, CCVars.ExplosionIncrementalTileBreaking, value => IncrementalTileBreaking = value, true);
|
|
Subs.CVar(_cfg, CCVars.ExplosionSingleTickAreaLimit, value => SingleTickAreaLimit = value, true);
|
|
}
|
|
}
|