eclipseCodeController initial state message - dont use WorldObject in ctor

This commit is contained in:
JohnCorby 2022-03-14 04:52:39 -07:00
parent 56e5a45467
commit f353fd8e8f
2 changed files with 4 additions and 4 deletions

View File

@ -10,10 +10,10 @@ internal class InitialStateMessage : QSBWorldObjectMessage<QSBEclipseCodeControl
private int _selectedDial;
private int[] _dialSelectedSymbols;
public InitialStateMessage()
public InitialStateMessage(EclipseCodeController4 eclipseCodeController)
{
_selectedDial = WorldObject.AttachedObject._selectedDial;
_dialSelectedSymbols = WorldObject.AttachedObject._dials.Select(x => x.GetSymbolSelected()).ToArray();
_selectedDial = eclipseCodeController._selectedDial;
_dialSelectedSymbols = eclipseCodeController._dials.Select(x => x.GetSymbolSelected()).ToArray();
}
public override void Serialize(NetworkWriter writer)

View File

@ -12,7 +12,7 @@ public class QSBEclipseCodeController : WorldObject<EclipseCodeController4>
public PlayerInfo PlayerInControl;
public override void SendInitialState(uint to)
=> this.SendMessage(new InitialStateMessage() { To = to });
=> this.SendMessage(new InitialStateMessage(AttachedObject) { To = to });
public override async UniTask Init(CancellationToken ct)
{