Ghost Roles (#3106)
* Add files for Ghost Roles. * Work on Ghost Roles * Improvements * GHOST ROLES IS DONE * mmm yes * auto-update when setting rolename/roledescription * well * command graceful error * Makes UI have a scrollbar when it has too many entries * fix command fuckup * Apply suggestions from code review Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com> Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
3923733113
commit
4c419f85ce
@@ -1,4 +1,5 @@
|
||||
#nullable enable
|
||||
using System.Threading;
|
||||
using Content.Server.Administration;
|
||||
using Content.Server.GameObjects.Components.Mobs;
|
||||
using Content.Server.GameObjects.Components.Movement;
|
||||
@@ -7,6 +8,7 @@ using Content.Shared.GameObjects.Components.Mobs.Speech;
|
||||
using Robust.Shared.Console;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.IoC;
|
||||
using Timer = Robust.Shared.Timers.Timer;
|
||||
|
||||
namespace Content.Server.Commands
|
||||
{
|
||||
@@ -44,10 +46,14 @@ namespace Content.Server.Commands
|
||||
if(entity.HasComponent<AiControllerComponent>())
|
||||
entity.RemoveComponent<AiControllerComponent>();
|
||||
|
||||
entity.EnsureComponent<MindComponent>();
|
||||
entity.EnsureComponent<PlayerInputMoverComponent>();
|
||||
entity.EnsureComponent<SharedSpeechComponent>();
|
||||
entity.EnsureComponent<SharedEmotingComponent>();
|
||||
// Delay spawning these components to avoid race conditions with the deferred removal of AiController.
|
||||
Timer.Spawn(100, () =>
|
||||
{
|
||||
entity.EnsureComponent<MindComponent>();
|
||||
entity.EnsureComponent<PlayerInputMoverComponent>();
|
||||
entity.EnsureComponent<SharedSpeechComponent>();
|
||||
entity.EnsureComponent<SharedEmotingComponent>();
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user