mirror of
https://github.com/All-Of-Us-Mods/MiraAPI.git
synced 2026-10-20 01:46:15 +00:00
Fix null error for player without assigned role
This commit is contained in:
1 parent
fdc715dac2
commit
8b23021b2a
1 file changed
+2
-2
@@ -20,7 +20,7 @@ public static class NameTagPatch
|
||||
return false;
|
||||
}
|
||||
|
||||
if (PlayerControl.LocalPlayer.Data.Role.IsImpostor && otherPlayerRole.IsImpostor)
|
||||
if (PlayerControl.LocalPlayer.Data?.Role?.IsImpostor == true && otherPlayerRole.IsImpostor)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@@ -30,7 +30,7 @@ public static class NameTagPatch
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!PlayerControl.LocalPlayer || !PlayerControl.LocalPlayer.Data || !PlayerControl.LocalPlayer.Data.Role || !otherPlayerRole)
|
||||
if (!PlayerControl.LocalPlayer || !PlayerControl.LocalPlayer.Data || !PlayerControl.LocalPlayer.Data?.Role || !otherPlayerRole)
|
||||
{
|
||||
__result = Color.white;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user