Fix dead players being able to run /home

This commit fixes an issue where players could bypass the respawn timer
by using /home. Specifically, TShock rejects the command if the player
is dead.
This commit is contained in:
Lucas Nicodemus 2021-06-12 22:26:01 -07:00
parent fd97c2268a
commit 4100ecb64e
2 changed files with 6 additions and 1 deletions

View file

@ -2724,6 +2724,11 @@ namespace TShockAPI
private static void Home(CommandArgs args)
{
if (args.Player.Dead)
{
args.Player.SendErrorMessage("You are dead.");
return;
}
args.Player.Spawn(PlayerSpawnContext.RecallFromItem);
args.Player.SendSuccessMessage("Teleported to your spawnpoint.");
}