Predict GetVerbsEvent in PowerSwitchableSystem (#39589)

* Prediction

* Update
This commit is contained in:
Winkarst-cpu
2025-08-13 10:54:02 +03:00
committed by GitHub
parent cea8dea005
commit 1f4dfcdcf9
5 changed files with 62 additions and 60 deletions

View File

@@ -9,6 +9,18 @@ namespace Content.Shared.Power.Generator;
/// <seealso cref="PortableGeneratorComponent"/>
public abstract class SharedPortableGeneratorSystem : EntitySystem
{
public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<FuelGeneratorComponent, SwitchPowerCheckEvent>(OnSwitchPowerCheck);
}
private void OnSwitchPowerCheck(EntityUid uid, FuelGeneratorComponent comp, ref SwitchPowerCheckEvent args)
{
if (comp.On)
args.DisableMessage = Loc.GetString("fuel-generator-verb-disable-on");
}
}
/// <summary>