Fix arcade goodbye message implementation (#26514)
This commit is contained in:
@@ -2,7 +2,6 @@ using Content.Server.Power.Components;
|
||||
using Content.Shared.UserInterface;
|
||||
using Content.Server.Advertise;
|
||||
using Content.Server.Advertise.Components;
|
||||
using Content.Server.Advertise.EntitySystems;
|
||||
using Content.Shared.Arcade;
|
||||
using Robust.Server.GameObjects;
|
||||
using Robust.Shared.Player;
|
||||
@@ -12,7 +11,7 @@ namespace Content.Server.Arcade.BlockGame;
|
||||
public sealed class BlockGameArcadeSystem : EntitySystem
|
||||
{
|
||||
[Dependency] private readonly UserInterfaceSystem _uiSystem = default!;
|
||||
[Dependency] private readonly AdvertiseSystem _advertise = default!;
|
||||
[Dependency] private readonly SpeakOnUIClosedSystem _speakOnUIClosed = default!;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
@@ -92,16 +91,6 @@ public sealed class BlockGameArcadeSystem : EntitySystem
|
||||
component.Spectators.Remove(component.Player);
|
||||
UpdatePlayerStatus(uid, component.Player, blockGame: component);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Everybody's gone
|
||||
component.Player = null;
|
||||
if (component.ShouldSayThankYou && TryComp<AdvertiseComponent>(uid, out var advertise))
|
||||
{
|
||||
_advertise.SayAdvertisement(uid, advertise);
|
||||
component.ShouldSayThankYou = false;
|
||||
}
|
||||
}
|
||||
|
||||
UpdatePlayerStatus(uid, temp, blockGame: component);
|
||||
}
|
||||
@@ -115,7 +104,6 @@ public sealed class BlockGameArcadeSystem : EntitySystem
|
||||
_uiSystem.CloseAll(bui);
|
||||
component.Player = null;
|
||||
component.Spectators.Clear();
|
||||
component.ShouldSayThankYou = false;
|
||||
}
|
||||
|
||||
private void OnPlayerAction(EntityUid uid, BlockGameArcadeComponent component, BlockGameMessages.BlockGamePlayerActionMessage msg)
|
||||
@@ -135,7 +123,8 @@ public sealed class BlockGameArcadeSystem : EntitySystem
|
||||
return;
|
||||
}
|
||||
|
||||
component.ShouldSayThankYou = true;
|
||||
if (TryComp<SpeakOnUIClosedComponent>(uid, out var speakComponent))
|
||||
_speakOnUIClosed.TrySetFlag((uid, speakComponent));
|
||||
|
||||
component.Game.ProcessInput(msg.PlayerAction);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user