From 7c09a174e88e78a9a968d33776a5c9b145717f8d Mon Sep 17 00:00:00 2001 From: Zidonuke Date: Tue, 20 Dec 2011 17:40:04 -0500 Subject: [PATCH] Quick fixes to new features. --- TShockAPI/ConfigFile.cs | 2 +- TShockAPI/GetDataHandlers.cs | 6 +++++- TShockAPI/TShock.cs | 6 +++--- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/TShockAPI/ConfigFile.cs b/TShockAPI/ConfigFile.cs index e1da8b94..052fa484 100644 --- a/TShockAPI/ConfigFile.cs +++ b/TShockAPI/ConfigFile.cs @@ -40,7 +40,7 @@ namespace TShockAPI [Description("Enable the ability for invaison size to never decrease. Make sure to run /invade, and note that this adds 2 million+ goblins to the spawn que for the map.")] public bool InfiniteInvasion; [Description("Enable or disable perma pvp.")] - public bool AlwaysPvP; + public bool AlwaysPvP = false; [Description("Kicks players who edit save files for cheating.")] public bool KickCheaters = true; [Description("Prevents tiles from being placed within SpawnProtectionRadius of the default spawn.")] diff --git a/TShockAPI/GetDataHandlers.cs b/TShockAPI/GetDataHandlers.cs index c57f8438..373a291a 100644 --- a/TShockAPI/GetDataHandlers.cs +++ b/TShockAPI/GetDataHandlers.cs @@ -571,10 +571,14 @@ namespace TShockAPI float distance = Vector2.Distance(new Vector2((pos.X / 16f), (pos.Y / 16f)), new Vector2(Main.spawnTileX, Main.spawnTileY)); if (TShock.CheckIgnores(args.Player) && distance > 6f) { - if (TShock.Config.AlwaysPvP) + if (TShock.Config.AlwaysPvP && !args.TPlayer.hostile) { args.Player.SendMessage("PvP is forced! Enable PvP else you can't move or do anything!", Color.Red); } + else if (TShock.Config.ServerSideInventory && !args.Player.IsLoggedIn) + { + args.Player.SendMessage("Server Side Inventory is enabled! Please /register or /login to play!", Color.Red); + } args.Player.Spawn(); return true; } diff --git a/TShockAPI/TShock.cs b/TShockAPI/TShock.cs index e13ea94e..44f5a84b 100644 --- a/TShockAPI/TShock.cs +++ b/TShockAPI/TShock.cs @@ -729,14 +729,14 @@ namespace TShockAPI TShock.Utils.HandleCheater(player, "Health/Mana cheat detected. Please use a different character."); } - if (TShock.Config.ServerSideInventory) + NetMessage.syncPlayers(); + + if (Config.ServerSideInventory && !player.IsLoggedIn) { player.IgnoreActionsForInventory = true; player.SendMessage("Server Side Inventory is enabled! Please /register or /login to play!", Color.Red); } - NetMessage.syncPlayers(); - if (Config.AlwaysPvP && !player.TPlayer.hostile) { player.IgnoreActionsForPvP = true;