Compare commits

..
Author SHA1 Message Date
miniduikboot 4452621cd3 Reset PlayerInfo on PlayerControl spawn
When (re)spawning players get a new player control netobject, which is
the perfect moment to discharge them from their former duties and reset
their PlayerInfo to a default state: no role, no tasks and not dead.
2024-08-13 21:18:22 +02:00
@@ -402,6 +402,13 @@ namespace Impostor.Server.Net.State
{
playerInfo.Controller = control;
control.PlayerInfo = playerInfo;
// Reset PlayerInfo
playerInfo.RoleType = null;
playerInfo.RoleWhenAlive = null;
playerInfo.Tasks.Clear();
playerInfo.IsDead = false;
playerInfo.IsDirty = true;
}
if (player != null)