diff --git a/TShockAPI/Commands.cs b/TShockAPI/Commands.cs index d638311e..2214f252 100644 --- a/TShockAPI/Commands.cs +++ b/TShockAPI/Commands.cs @@ -787,6 +787,10 @@ namespace TShockAPI // We need to emulate the checks done in Player.TrySwitchingLoadout, because otherwise the server is not allowed to sync the // loadout index to the player, causing catastrophic desync. // The player must not be dead, using an item, or CC'd to switch loadouts. + + // Note that we only check for CC'd players when SSC is enabled, as that is only where it can cause issues, + // and the RequireLogin config option (without SSC) will disable player's until they login, creating a vicious cycle. + // FIXME: There is always the chance that in-between the time we check these requirements on the server, and the loadout sync // packet reaches the client, that the client state has changed, causing the loadout sync to be rejected, even though // we expected it to succeed. @@ -805,7 +809,7 @@ namespace TShockAPI return; } - if (args.TPlayer.CCed) + if (args.TPlayer.CCed && Main.ServerSideCharacter) { args.Player.SendErrorMessage(GetString("You cannot login whilst crowd controlled.")); return;