You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: MLAPI/Serialization/BitWriter.cs
+14Lines changed: 14 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -189,6 +189,10 @@ public void WriteObjectPacked(object value)
189
189
{
190
190
thrownewArgumentException("BitWriter cannot write GameObject types that does not has a NetworkedObject component attached. GameObject: "+((GameObject)value).name);
191
191
}
192
+
elseif(!networkedObject.IsSpawned)
193
+
{
194
+
thrownewArgumentException("BitWriter cannot write NetworkedObject types that are not spawned. GameObject: "+((GameObject)value).name);
195
+
}
192
196
else
193
197
{
194
198
WriteUInt64Packed(networkedObject.NetworkId);
@@ -197,11 +201,21 @@ public void WriteObjectPacked(object value)
197
201
}
198
202
elseif(valueisNetworkedObject)
199
203
{
204
+
if(!((NetworkedObject)value).IsSpawned)
205
+
{
206
+
thrownewArgumentException("BitWriter cannot write NetworkedObject types that are not spawned. GameObject: "+((GameObject)value).name);
0 commit comments