From 42ffae376ebc6891c2784273120d192b70e8368a Mon Sep 17 00:00:00 2001 From: wrexbe <81056464+wrexbe@users.noreply.github.com> Date: Wed, 2 Feb 2022 15:14:42 -0800 Subject: [PATCH] Fix toilet suicide messages (#6445) Co-authored-by: mirrorcult --- Content.Server/Toilet/ToiletSystem.cs | 20 +++++++------------ .../Locale/en-US/toilet/toilet-component.ftl | 8 ++++---- 2 files changed, 11 insertions(+), 17 deletions(-) diff --git a/Content.Server/Toilet/ToiletSystem.cs b/Content.Server/Toilet/ToiletSystem.cs index 2113bd5291..9dc6121e6a 100644 --- a/Content.Server/Toilet/ToiletSystem.cs +++ b/Content.Server/Toilet/ToiletSystem.cs @@ -1,4 +1,4 @@ -using Content.Server.Act; +using Content.Server.Act; using Content.Server.Buckle.Components; using Content.Server.Popups; using Content.Server.Storage.Components; @@ -126,22 +126,16 @@ namespace Content.Server.Toilet public SuicideKind Suicide(EntityUid uid, EntityUid victimUid, ToiletComponent? component = null, MetaDataComponent? meta = null, MetaDataComponent? victimMeta = null) { - if (!Resolve(uid, ref component, ref meta)) - return SuicideKind.Special; - - if (!Resolve(uid, ref victimMeta)) - return SuicideKind.Special; - // check that victim even have head if (EntityManager.TryGetComponent(victimUid, out var body) && body.HasPartOfType(BodyPartType.Head)) { var othersMessage = Loc.GetString("toilet-component-suicide-head-message-others", - ("victim",victimMeta.Name),("owner", meta.Name)); - _popupSystem.PopupEntity(othersMessage, uid, Filter.Pvs(victimUid)); + ("victim", victimUid),("owner", uid)); + _popupSystem.PopupEntity(othersMessage, uid, Filter.Pvs(victimUid).RemoveWhereAttachedEntity(puid => puid == victimUid)); var selfMessage = Loc.GetString("toilet-component-suicide-head-message", - ("owner", meta.Name)); + ("owner", uid)); _popupSystem.PopupEntity(selfMessage, uid, Filter.Entities(victimUid)); return SuicideKind.Asphyxiation; @@ -149,11 +143,11 @@ namespace Content.Server.Toilet else { var othersMessage = Loc.GetString("toilet-component-suicide-message-others", - ("victim", victimMeta.Name),("owner", meta.Name)); - _popupSystem.PopupEntity(othersMessage, uid, Filter.Pvs(uid)); + ("victim", victimUid),("owner", uid)); + _popupSystem.PopupEntity(othersMessage, uid, Filter.Pvs(uid).RemoveWhereAttachedEntity(puid => puid == victimUid)); var selfMessage = Loc.GetString("toilet-component-suicide-message", - ("owner",meta.Name)); + ("owner", uid)); _popupSystem.PopupEntity(selfMessage, uid, Filter.Entities(victimUid)); return SuicideKind.Blunt; diff --git a/Resources/Locale/en-US/toilet/toilet-component.ftl b/Resources/Locale/en-US/toilet/toilet-component.ftl index 3f589f78bf..f5021e7451 100644 --- a/Resources/Locale/en-US/toilet/toilet-component.ftl +++ b/Resources/Locale/en-US/toilet/toilet-component.ftl @@ -1,7 +1,7 @@ ## ToiletComponent toilet-component-on-examine-found-hidden-item = There is [color=darkgreen]something[/color] inside cistern! -toilet-component-suicide-head-message-others = {$victim} sticks their head into {$owner} and flushes it! -toilet-component-suicide-head-message = You stick your head into {$owner} and flush it! -toilet-component-suicide-message-others = {$victim} bashes themselves with {$owner}! -toilet-component-suicide-message = You bash yourself with {$owner}! \ No newline at end of file +toilet-component-suicide-head-message-others = {CAPITALIZE(THE($victim))} sticks their head into {THE($owner)} and flushes it! +toilet-component-suicide-head-message = You stick your head into {THE($owner)} and flush it! +toilet-component-suicide-message-others = {CAPITALIZE(THE($victim))} bashes themselves with {THE($owner)}! +toilet-component-suicide-message = You bash yourself with {THE($owner)}!