Я починил дилдо блять... (#165)

This commit is contained in:
BIGZi0348
2024-11-08 20:56:26 +03:00
committed by GitHub
parent 0f35e94fa2
commit e4fbe81aa7
3 changed files with 22 additions and 18 deletions

View File

@@ -6,31 +6,31 @@ public abstract class SharedVibratorSystem : EntitySystem
{
public override void Initialize()
{
SubscribeLocalEvent<VibratorComponent,ComponentGetState>(OnGetState);
SubscribeLocalEvent<VibratorComponent,ComponentHandleState>(OnHandleState);
SubscribeLocalEvent<VibratorComponent, ComponentGetState>(OnGetState);
SubscribeLocalEvent<VibratorComponent, ComponentHandleState>(OnHandleState);
}
private void OnHandleState(EntityUid uid, VibratorComponent component, ref ComponentHandleState args)
{
if(args.Current is not VibratorComponentState state)
if (args.Current is not VibratorComponentState state)
return;
component.IsVibrating = state.IsVibrating;
ToggleVibrate(uid,component);
ToggleVibrate(uid, component);
}
private void OnGetState(EntityUid uid, VibratorComponent component,ref ComponentGetState args)
private void OnGetState(EntityUid uid, VibratorComponent component, ref ComponentGetState args)
{
args.State = new VibratorComponentState(component.IsVibrating);
}
public void ToggleVibration(EntityUid uid, VibratorComponent? component = null)
{
if(!Resolve(uid,ref component))
if (!Resolve(uid, ref component))
return;
component.IsVibrating = !component.IsVibrating;
Dirty(uid,component);
Dirty(uid, component);
}
public virtual void ToggleVibrate(EntityUid uid, VibratorComponent component)