mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-01-01 03:32:38 +00:00
eclipseCodeController initial state message - dont use WorldObject in ctor
This commit is contained in:
parent
56e5a45467
commit
f353fd8e8f
@ -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)
|
||||
|
@ -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)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user