mirror of
https://github.com/Impostor/Impostor.git
synced 2026-10-19 15:51:42 +00:00
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.
This commit is contained in:
1 parent
53209aa78f
commit
4452621cd3
1 file changed
+7
@@ -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)
|
||||
|
||||
Reference in new issue
Block a user