mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-01-17 01:13:05 +00:00
fix issues with icon/name not updating and NRE
This commit is contained in:
parent
51ced1c474
commit
be99b6957e
@ -36,7 +36,7 @@ public class PlayerInformationMessage : QSBMessage
|
||||
ClientState = player.State;
|
||||
FieldOfView = PlayerData.GetGraphicSettings().fieldOfView;
|
||||
IsInShip = player.IsInShip;
|
||||
HUDIcon = player.HUDBox.PlanetIcon;
|
||||
HUDIcon = player.HUDBox == null ? HUDIcon.UNKNOWN : player.HUDBox.PlanetIcon;
|
||||
}
|
||||
|
||||
public override void Serialize(NetworkWriter writer)
|
||||
@ -99,11 +99,11 @@ public class PlayerInformationMessage : QSBMessage
|
||||
|
||||
player.State = ClientState;
|
||||
|
||||
if (player.HUDBox != null)
|
||||
Delay.RunWhen(() => player.HUDBox != null, () =>
|
||||
{
|
||||
player.HUDBox.PlayerName.text = PlayerName.ToUpper();
|
||||
player.HUDBox.UpdateIcon(HUDIcon);
|
||||
}
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user