diff --git a/TShockAPI/ConfigFile.cs b/TShockAPI/ConfigFile.cs index 3294352c..9ccc2f4c 100644 --- a/TShockAPI/ConfigFile.cs +++ b/TShockAPI/ConfigFile.cs @@ -193,7 +193,7 @@ namespace TShockAPI public string ForceTime = "normal"; [Description("Disable/Revert a player if they exceed this number of tile kills within 1 second.")] - public int TileKillThreshold = 80; + public int TileKillThreshold = 60; [Description("Disable/Revert a player if they exceed this number of tile places within 1 second.")] public int TilePlaceThreshold = 20; @@ -202,7 +202,7 @@ namespace TShockAPI public int TileLiquidThreshold = 15; [Description("Disable a player if they exceed this number of projectile new within 1 second.")] - public int ProjectileThreshold = 100; + public int ProjectileThreshold = 50; [Description("Require all players to register or login before being allowed to play.")] public bool RequireLogin = false; diff --git a/TShockAPI/GetDataHandlers.cs b/TShockAPI/GetDataHandlers.cs index 99819d5f..899af18c 100644 --- a/TShockAPI/GetDataHandlers.cs +++ b/TShockAPI/GetDataHandlers.cs @@ -597,7 +597,7 @@ namespace TShockAPI args.Player.SendTileSquare(tileX, tileY); return true; } - if (tiletype == 48 && !args.Player.Group.HasPermission(Permissions.usebanneditem) && TShock.Itembans.ItemIsBanned("Spikes", args.Player)) + if (tiletype == 48 && !args.Player.Group.HasPermission(Permissions.usebanneditem) && TShock.Itembans.ItemIsBanned("Spike", args.Player)) { args.Player.SendTileSquare(tileX, tileY); return true; @@ -757,6 +757,11 @@ namespace TShockAPI return true; } + if (args.Player.Dead) + { + return true; + } + if (!args.Player.Group.HasPermission(Permissions.ignorenoclipdetection) && Collision.SolidCollision(pos, args.TPlayer.width, args.TPlayer.height)) { int lastTileX = (int)(args.Player.LastNetPosition.X / 16f); @@ -959,9 +964,7 @@ namespace TShockAPI } args.Player.LastDeath = DateTime.Now; - - if (args.Player.Difficulty != 2) - args.Player.ForceSpawn = true; + args.Player.Dead = true; return false; } @@ -1107,7 +1110,7 @@ namespace TShockAPI else args.Player.InitSpawn = true; - args.Player.ForceSpawn = false; + args.Player.Dead = false; return false; } diff --git a/TShockAPI/TSPlayer.cs b/TShockAPI/TSPlayer.cs index 6719259d..92e69dbf 100644 --- a/TShockAPI/TSPlayer.cs +++ b/TShockAPI/TSPlayer.cs @@ -65,7 +65,7 @@ namespace TShockAPI Player FakePlayer; public bool RequestedSection = false; public DateTime LastDeath { get; set; } - public bool ForceSpawn = false; + public bool Dead = false; public string Country = "??"; public int Difficulty; private string CacheIP; diff --git a/TShockAPI/TShock.cs b/TShockAPI/TShock.cs index 956cd74f..0edbc025 100644 --- a/TShockAPI/TShock.cs +++ b/TShockAPI/TShock.cs @@ -528,7 +528,7 @@ namespace TShockAPI { player.ProjectileThreshold = 0; } - if (player.ForceSpawn && (DateTime.Now - player.LastDeath).Seconds >= 3) + if (player.Dead && (DateTime.Now - player.LastDeath).Seconds >= 3 && player.Difficulty != 2) { player.Spawn(); } @@ -761,7 +761,7 @@ namespace TShockAPI return; } - if ((player.State < 10 || player.ForceSpawn) && (int)type > 12 && (int)type != 16 && (int)type != 42 && (int)type != 50 && (int)type != 38) + if ((player.State < 10 || player.Dead) && (int)type > 12 && (int)type != 16 && (int)type != 42 && (int)type != 50 && (int)type != 38) { e.Handled = true; return; @@ -1016,7 +1016,7 @@ namespace TShockAPI return true; } - if (type == 17 && !player.Group.HasPermission(Permissions.usebanneditem) && TShock.Itembans.ItemIsBanned("Dirt Wand", player)) //Dirt Wand Projectile + if (type == 17 && !player.Group.HasPermission(Permissions.usebanneditem) && TShock.Itembans.ItemIsBanned("Dirt Rod", player)) //Dirt Rod Projectile { return true; }