Players are randomly unable to respawn immediately after dying; occurs randomly. Here is the console error:
AssertionException: Assertion failure. Value was False
Expected: True
Stomping old lifeStory
I found the following thread and came up with the solution to just parse server entities and delete the 'duplicated' player - which works after manual deletion. However, I am searching for a solution to what is causing this issue to prevent it altogether. Here is the code I am using when OnPlayerDie is called:
private void OnPlayerDie(BasePlayer player, HitInfo info)
{
var npc = player?.GetComponent<NPCPlayer>();
if (npc) return;
var p = checkAndReturnInstancePlayer(player.userID); //RETURNS BASEPLAYER
if (p == null) return;
if (p != null)
{
timer.Once(1.5f, () => {
if (player && player.IsConnected)
{
player.RespawnAt(new Vector3(1, 1, 1), new Quaternion(0, 0, 0, 0));
player.EndSleeping();
player.inventory.Strip();
}
});
}
return;
}
I was using NextTick() before switching it to timer.Once() but the same issue is still occurring - no other code from any other plugins are using this hook other than this. Any help seriously appreciated