Prevents suicide if someone is already dead (#7677)
* Prevents suicide if someone is already dead * Adds the Localization text for trying to suicide when dead
This commit is contained in:
@@ -21,6 +21,7 @@ using Robust.Shared.IoC;
|
||||
using Robust.Shared.Localization;
|
||||
using Robust.Shared.Map;
|
||||
using Robust.Shared.Prototypes;
|
||||
using Content.Shared.MobState.Components;
|
||||
|
||||
namespace Content.Server.Chat.Commands
|
||||
{
|
||||
@@ -83,6 +84,13 @@ namespace Content.Server.Chat.Commands
|
||||
return;
|
||||
}
|
||||
|
||||
//Checks to see if the player is dead.
|
||||
if(_entities.TryGetComponent<MobStateComponent>(owner, out var mobState) && mobState.IsDead())
|
||||
{
|
||||
shell.WriteLine(Loc.GetString("suicide-command-already-dead"));
|
||||
return;
|
||||
}
|
||||
|
||||
//Checks to see if the CannotSuicide tag exits, ghosts instead.
|
||||
if(EntitySystem.Get<TagSystem>().HasTag(owner, "CannotSuicide"))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user