Restrict ghost role speech/movement to component flags (#11183)

This commit is contained in:
Flipp Syder
2022-09-13 20:46:49 -07:00
committed by GitHub
parent dcd72cccba
commit f9922d9160
11 changed files with 45 additions and 10 deletions

View File

@@ -63,6 +63,14 @@ namespace Content.Server.Ghost.Roles.Components
}
}
[DataField("allowSpeech")]
[ViewVariables(VVAccess.ReadWrite)]
public bool AllowSpeech { get; set; } = true;
[DataField("allowMovement")]
[ViewVariables(VVAccess.ReadWrite)]
public bool AllowMovement { get; set; }
[ViewVariables(VVAccess.ReadOnly)]
public bool Taken { get; set; }

View File

@@ -46,7 +46,7 @@ namespace Content.Server.Ghost.Roles.Components
_entMan.EventBus.RaiseLocalEvent(mob, spawnedEvent, false);
if (MakeSentient)
MakeSentientCommand.MakeSentient(mob, _entMan);
MakeSentientCommand.MakeSentient(mob, _entMan, AllowMovement, AllowSpeech);
mob.EnsureComponent<MindComponent>();

View File

@@ -23,7 +23,7 @@ namespace Content.Server.Ghost.Roles.Components
return false;
if (MakeSentient)
MakeSentientCommand.MakeSentient(Owner, IoCManager.Resolve<IEntityManager>());
MakeSentientCommand.MakeSentient(Owner, IoCManager.Resolve<IEntityManager>(), AllowMovement, AllowSpeech);
var ghostRoleSystem = EntitySystem.Get<GhostRoleSystem>();
ghostRoleSystem.GhostRoleInternalCreateMindAndTransfer(session, Owner, Owner, this);