Skip to content

Commit

Permalink
Fix detective TC find message appearing every time
Browse files Browse the repository at this point in the history
  • Loading branch information
Simyon264 committed Nov 8, 2024
1 parent b68f00d commit b3137c5
Showing 1 changed file with 14 additions and 11 deletions.
25 changes: 14 additions & 11 deletions Content.Server/_SSS/SuspicionGameRule/SuspicionRuleSystem.Rules.cs
Original file line number Diff line number Diff line change
Expand Up @@ -152,18 +152,21 @@ private void OnExamine(EntityUid uid, SuspicionPlayerComponent component, ref Ex
AddTcToPlayer(args.Examiner, tc);
implantT.Value.Comp.Balance.Clear();

if (_playerManager.TryGetSessionByEntity(args.Examiner, out var session))
if (tc >= 0)
{
var msgFound = Loc.GetString("suspicion-found-tc", ("tc", tc));
_chatManager.ChatMessageToOne(
ChatChannel.Server,
msgFound,
msgFound,
EntityUid.Invalid,
false,
client: session.Channel,
recordReplay:true
);
if (_playerManager.TryGetSessionByEntity(args.Examiner, out var session))
{
var msgFound = Loc.GetString("suspicion-found-tc", ("tc", tc));
_chatManager.ChatMessageToOne(
ChatChannel.Server,
msgFound,
msgFound,
EntityUid.Invalid,
false,
client: session.Channel,
recordReplay:true
);
}
}
}
}
Expand Down

0 comments on commit b3137c5

Please sign in to comment.