Fix player respawn again (#1830)

* fix respawn time unit, add spawn bouncer, add respawn time config warning

Co-authored-by: Lucas Nicodemus <shank@shanked.me>
This commit is contained in:
Axeel 2020-05-21 13:37:31 +08:00 committed by GitHub
parent 341424248c
commit 56a9e27365
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 7 deletions

View file

@ -299,9 +299,10 @@ namespace TShockAPI
/// </summary>
public int RespawnTimer
{
get => TPlayer.respawnTimer;
set => TPlayer.respawnTimer = value;
get => _respawnTimer;
set => TPlayer.respawnTimer = (_respawnTimer = value) * 60;
}
private int _respawnTimer;
/// <summary>
/// Whether the player is dead or not.
@ -1196,7 +1197,7 @@ namespace TShockAPI
PlayerIndex = (byte)Index,
TileX = (short)tilex,
TileY = (short)tiley,
RespawnTimer = respawnTimer ?? TShock.Players[Index].TPlayer.respawnTimer,
RespawnTimer = respawnTimer ?? TShock.Players[Index].RespawnTimer * 60,
PlayerSpawnContext = context,
};
msg.PackFull(ms);