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:
parent
fd97c2268a
commit
4100ecb64e
2 changed files with 6 additions and 1 deletions
|
|
@ -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.");
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue