[Fix] Check for character changed after ghost respawn (#430)
This commit is contained in:
@@ -4,14 +4,18 @@ using System.Numerics;
|
||||
using Content.Server.Administration.Managers;
|
||||
using System.Text;
|
||||
using Content.Server.Ghost;
|
||||
using Content.Server.Mind;
|
||||
using Content.Server.Players;
|
||||
using Content.Server.Spawners.Components;
|
||||
using Content.Server.Speech.Components;
|
||||
using Content.Server.Station.Components;
|
||||
using Content.Shared.CCVar;
|
||||
using Content.Shared.Chat;
|
||||
using Content.Shared.Database;
|
||||
using Content.Shared.GameTicking;
|
||||
using Content.Shared.Players;
|
||||
using Content.Shared.Humanoid.Prototypes;
|
||||
using Content.Shared.Mind;
|
||||
using Content.Shared.Preferences;
|
||||
using Content.Shared.Roles;
|
||||
using Content.Shared.Roles.Jobs;
|
||||
@@ -158,6 +162,27 @@ namespace Content.Server.GameTicking
|
||||
return;
|
||||
}
|
||||
|
||||
//WD start
|
||||
//Ghost system return to round, check for whether the character isn't the same.
|
||||
if (lateJoin)
|
||||
{
|
||||
var allPlayerMinds = EntityQuery<MindComponent>()
|
||||
.Where(mind => mind.OriginalOwnerUserId == player.UserId);
|
||||
foreach (var mind in allPlayerMinds)
|
||||
{
|
||||
if (mind.CharacterName == character.Name && !_adminManager.IsAdmin(player))
|
||||
{
|
||||
var message = Loc.GetString("ghost-respawn-same-character");
|
||||
var wrappedMessage = Loc.GetString("chat-manager-server-wrap-message", ("message", message));
|
||||
_chatManager.ChatMessageToOne(ChatChannel.Server, message, wrappedMessage,
|
||||
default, false, player.ConnectedClient, Color.Red);
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
//WD end
|
||||
|
||||
// Automatically de-admin players who are joining.
|
||||
if (_cfg.GetCVar(CCVars.AdminDeadminOnJoin) && _adminManager.IsAdmin(player))
|
||||
_adminManager.DeAdmin(player);
|
||||
|
||||
Reference in New Issue
Block a user