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.

This commit is contained in:
Zidonuke 2011-12-28 22:57:41 -05:00
parent 5619ae3660
commit 3350418f5d
2 changed files with 2 additions and 2 deletions

View file

@ -1118,6 +1118,7 @@ namespace TShockAPI
else else
args.Player.InitSpawn = true; args.Player.InitSpawn = true;
args.Player.ForceSpawn = false;
return false; return false;
} }

View file

@ -531,7 +531,6 @@ namespace TShockAPI
if (player.ForceSpawn && (DateTime.Now - player.LastDeath).Seconds >= 3) if (player.ForceSpawn && (DateTime.Now - player.LastDeath).Seconds >= 3)
{ {
player.Spawn(); player.Spawn();
player.ForceSpawn = false;
} }
} }
} }
@ -764,7 +763,7 @@ namespace TShockAPI
return; 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; e.Handled = true;
return; return;