From 3350418f5dfbbcb26773c7f363a7552ef02a7d9d Mon Sep 17 00:00:00 2001 From: Zidonuke Date: Wed, 28 Dec 2011 22:57:41 -0500 Subject: [PATCH] Protect server from dead players until they tell us they respawned. ForceRespawn will spam client until they notify us of a respawn. Prevents silly people from exploiting in dead. --- TShockAPI/GetDataHandlers.cs | 1 + TShockAPI/TShock.cs | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/TShockAPI/GetDataHandlers.cs b/TShockAPI/GetDataHandlers.cs index 2512172a..09c26f16 100644 --- a/TShockAPI/GetDataHandlers.cs +++ b/TShockAPI/GetDataHandlers.cs @@ -1118,6 +1118,7 @@ namespace TShockAPI else args.Player.InitSpawn = true; + args.Player.ForceSpawn = false; return false; } diff --git a/TShockAPI/TShock.cs b/TShockAPI/TShock.cs index fdf0ff8a..a2ed9927 100644 --- a/TShockAPI/TShock.cs +++ b/TShockAPI/TShock.cs @@ -531,7 +531,6 @@ namespace TShockAPI if (player.ForceSpawn && (DateTime.Now - player.LastDeath).Seconds >= 3) { player.Spawn(); - player.ForceSpawn = false; } } } @@ -764,7 +763,7 @@ namespace TShockAPI return; } - if (player.State < 10 && (int)type > 12 && (int)type != 16 && (int)type != 42 && (int)type != 50 && (int)type != 38) + if ((player.State < 10 || player.ForceSpawn) && (int)type > 12 && (int)type != 16 && (int)type != 42 && (int)type != 50 && (int)type != 38) { e.Handled = true; return;