Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ AdjustRespawnTimerForWorldJoining()

static void Terraria.Player.AdjustRespawnTimerForWorldJoining ( Player newPlayer)
inlinestaticprivate

Definition at line 52174 of file Player.cs.

52175 {
52176 if (Main.myPlayer != newPlayer.whoAmI || !newPlayer.dead)
52177 {
52178 return;
52179 }
52180 long num = DateTime.UtcNow.ToBinary() - newPlayer.lastTimePlayerWasSaved;
52181 if (num > 0)
52182 {
52183 int num2 = Utils.Clamp((int)(Utils.Clamp(new TimeSpan(num).TotalSeconds, 0.0, 1000.0) * 60.0), 0, newPlayer.respawnTimer);
52184 newPlayer.respawnTimer -= num2;
52185 if (newPlayer.respawnTimer == 0)
52186 {
52187 newPlayer.dead = false;
52188 }
52189 }
52190 }
static unsafe DateTime UtcNow
Definition DateTime.cs:142

References Terraria.Main.myPlayer, and System.DateTime.UtcNow.