Flashable cangetstate ref (#6441)
This commit is contained in:
@@ -13,14 +13,14 @@ namespace Content.Shared.Flash
|
|||||||
SubscribeLocalEvent<SharedFlashableComponent, ComponentGetStateAttemptEvent>(OnGetStateAttempt);
|
SubscribeLocalEvent<SharedFlashableComponent, ComponentGetStateAttemptEvent>(OnGetStateAttempt);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnGetStateAttempt(EntityUid uid, SharedFlashableComponent component, ComponentGetStateAttemptEvent args)
|
private static void OnGetStateAttempt(EntityUid uid, SharedFlashableComponent component, ref ComponentGetStateAttemptEvent args)
|
||||||
{
|
{
|
||||||
// Only send state to the player attached to the entity.
|
// Only send state to the player attached to the entity.
|
||||||
if (args.Player.AttachedEntity != uid)
|
if (args.Player.AttachedEntity != uid)
|
||||||
args.Cancel();
|
args.Cancelled = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnFlashableGetState(EntityUid uid, SharedFlashableComponent component, ref ComponentGetState args)
|
private static void OnFlashableGetState(EntityUid uid, SharedFlashableComponent component, ref ComponentGetState args)
|
||||||
{
|
{
|
||||||
args.State = new FlashableComponentState(component.Duration, component.LastFlash);
|
args.State = new FlashableComponentState(component.Duration, component.LastFlash);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user