mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-01-29 09:32:38 +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;
|
ClientState = player.State;
|
||||||
FieldOfView = PlayerData.GetGraphicSettings().fieldOfView;
|
FieldOfView = PlayerData.GetGraphicSettings().fieldOfView;
|
||||||
IsInShip = player.IsInShip;
|
IsInShip = player.IsInShip;
|
||||||
HUDIcon = player.HUDBox.PlanetIcon;
|
HUDIcon = player.HUDBox == null ? HUDIcon.UNKNOWN : player.HUDBox.PlanetIcon;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Serialize(NetworkWriter writer)
|
public override void Serialize(NetworkWriter writer)
|
||||||
@ -99,11 +99,11 @@ public class PlayerInformationMessage : QSBMessage
|
|||||||
|
|
||||||
player.State = ClientState;
|
player.State = ClientState;
|
||||||
|
|
||||||
if (player.HUDBox != null)
|
Delay.RunWhen(() => player.HUDBox != null, () =>
|
||||||
{
|
{
|
||||||
player.HUDBox.PlayerName.text = PlayerName.ToUpper();
|
player.HUDBox.PlayerName.text = PlayerName.ToUpper();
|
||||||
player.HUDBox.UpdateIcon(HUDIcon);
|
player.HUDBox.UpdateIcon(HUDIcon);
|
||||||
}
|
});
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user