Changed the way the SecondUpdate checks work
This commit is contained in:
parent
33739c4f07
commit
1faf064983
1 changed files with 24 additions and 3 deletions
|
|
@ -961,7 +961,22 @@ namespace TShockAPI
|
||||||
{
|
{
|
||||||
player.Spawn();
|
player.Spawn();
|
||||||
}
|
}
|
||||||
if (!Main.ServerSideCharacter || (Main.ServerSideCharacter && player.IsLoggedIn))
|
|
||||||
|
if (Main.ServerSideCharacter && !player.IsLoggedIn)
|
||||||
|
{
|
||||||
|
DisableFlags flags = Config.DisableSecondUpdateLogs ? DisableFlags.WriteToConsole : DisableFlags.WriteToLogAndConsole;
|
||||||
|
|
||||||
|
if (CheckIgnores(player))
|
||||||
|
{
|
||||||
|
player.Disable("not being logged in while SSC is enabled", flags);
|
||||||
|
}
|
||||||
|
else if (Itembans.ItemIsBanned(player.TPlayer.inventory[player.TPlayer.selectedItem].name, player))
|
||||||
|
{
|
||||||
|
player.Disable($"holding banned item: {player.TPlayer.inventory[player.TPlayer.selectedItem].name}", flags);
|
||||||
|
player.SendErrorMessage($"You are holding a banned item: {player.TPlayer.inventory[player.TPlayer.selectedItem].name}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (!Main.ServerSideCharacter || (Main.ServerSideCharacter && player.IsLoggedIn))
|
||||||
{
|
{
|
||||||
string check = "none";
|
string check = "none";
|
||||||
foreach (Item item in player.TPlayer.inventory)
|
foreach (Item item in player.TPlayer.inventory)
|
||||||
|
|
@ -1030,11 +1045,17 @@ namespace TShockAPI
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
player.IgnoreActionsForDisabledArmor = check;
|
player.IgnoreActionsForDisabledArmor = check;
|
||||||
if (CheckIgnores(player) || Itembans.ItemIsBanned(player.TPlayer.inventory[player.TPlayer.selectedItem].name, player))
|
DisableFlags flags = Config.DisableSecondUpdateLogs ? DisableFlags.WriteToConsole : DisableFlags.WriteToLogAndConsole;
|
||||||
|
|
||||||
|
if (CheckIgnores(player))
|
||||||
{
|
{
|
||||||
DisableFlags flags = Config.DisableSecondUpdateLogs ? DisableFlags.WriteToConsole : DisableFlags.WriteToLogAndConsole;
|
|
||||||
player.Disable("check ignores failed in OnSecondUpdate()", flags);
|
player.Disable("check ignores failed in OnSecondUpdate()", flags);
|
||||||
}
|
}
|
||||||
|
else if (Itembans.ItemIsBanned(player.TPlayer.inventory[player.TPlayer.selectedItem].name, player))
|
||||||
|
{
|
||||||
|
player.Disable($"holding banned item: {player.TPlayer.inventory[player.TPlayer.selectedItem].name}", flags);
|
||||||
|
player.SendErrorMessage($"You are holding a banned item: {player.TPlayer.inventory[player.TPlayer.selectedItem].name}");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var oldRegion = player.CurrentRegion;
|
var oldRegion = player.CurrentRegion;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue