From 25ca94a77eb9a93b446f0005a353c49ef3e27dcd Mon Sep 17 00:00:00 2001 From: Zack Piispanen Date: Thu, 3 Oct 2013 17:30:29 -0400 Subject: [PATCH] Customize the time in between death and respawn. --- TShockAPI/ConfigFile.cs | 2 ++ TShockAPI/TShock.cs | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/TShockAPI/ConfigFile.cs b/TShockAPI/ConfigFile.cs index 43e1f3be..22aa0897 100644 --- a/TShockAPI/ConfigFile.cs +++ b/TShockAPI/ConfigFile.cs @@ -277,6 +277,8 @@ namespace TShockAPI [Description("The number of reserved slots past your max server slot that can be joined by reserved players")] public bool LogRest = false; + [Description("The number of seconds a player must wait before being respawned.")] public int RespawnSeconds = 3; + /// /// Reads a configuration file from a given path /// diff --git a/TShockAPI/TShock.cs b/TShockAPI/TShock.cs index 73d03f4e..8e502edf 100755 --- a/TShockAPI/TShock.cs +++ b/TShockAPI/TShock.cs @@ -715,7 +715,7 @@ namespace TShockAPI { player.ProjectileThreshold = 0; } - if (player.Dead && (DateTime.Now - player.LastDeath).Seconds >= 3 && player.Difficulty != 2) + if (player.Dead && (DateTime.Now - player.LastDeath).Seconds >= Config.RespawnSeconds && player.Difficulty != 2) { player.Spawn(); }