@@ -593,7 +593,7 @@ internal void SyncVarUpdate()
593
593
FieldTypeHelper . WriteFieldType ( writer , syncedVarFields [ i ] . FieldInfo . GetValue ( this ) , syncedVarFields [ i ] . FieldValue ) ;
594
594
syncedVarFields [ i ] . FieldValue = FieldTypeHelper . GetReferenceArrayValue ( syncedVarFields [ i ] . FieldInfo . GetValue ( this ) , syncedVarFields [ i ] . FieldValue ) ;
595
595
syncedVarFields [ i ] . Dirty = false ;
596
- invokeSyncvarMethodOnHost ( syncedVarFields [ i ] . HookMethod ) ;
596
+ InvokeSyncvarMethodOnServer ( syncedVarFields [ i ] . HookMethod ) ;
597
597
}
598
598
}
599
599
List < uint > stillDirtyIds = InternalMessageHandler . Send ( "MLAPI_SYNC_VAR_UPDATE" , "MLAPI_INTERNAL" , writer , networkId ) ;
@@ -629,7 +629,7 @@ internal void SyncVarUpdate()
629
629
//Only targeted SyncedVars were changed. Thus we need to set them as non dirty here since it wont be done by the next loop.
630
630
syncedVarFields [ i ] . FieldValue = FieldTypeHelper . GetReferenceArrayValue ( syncedVarFields [ i ] . FieldInfo . GetValue ( this ) , syncedVarFields [ i ] . FieldValue ) ;
631
631
syncedVarFields [ i ] . Dirty = false ;
632
- invokeSyncvarMethodOnHost ( syncedVarFields [ i ] . HookMethod ) ;
632
+ InvokeSyncvarMethodOnServer ( syncedVarFields [ i ] . HookMethod ) ;
633
633
}
634
634
}
635
635
}
@@ -660,7 +660,7 @@ internal void SyncVarUpdate()
660
660
FieldTypeHelper . WriteFieldType ( writer , syncedVarFields [ i ] . FieldInfo . GetValue ( this ) , syncedVarFields [ i ] . FieldValue ) ;
661
661
syncedVarFields [ i ] . FieldValue = FieldTypeHelper . GetReferenceArrayValue ( syncedVarFields [ i ] . FieldInfo . GetValue ( this ) , syncedVarFields [ i ] . FieldValue ) ;
662
662
syncedVarFields [ i ] . Dirty = false ;
663
- invokeSyncvarMethodOnHost ( syncedVarFields [ i ] . HookMethod ) ;
663
+ InvokeSyncvarMethodOnServer ( syncedVarFields [ i ] . HookMethod ) ;
664
664
}
665
665
}
666
666
List < uint > stillDirtyIds = InternalMessageHandler . Send ( "MLAPI_SYNC_VAR_UPDATE" , "MLAPI_INTERNAL" , writer , ownerClientId , networkId , null , null ) ; // Send to everyone except target.
@@ -673,9 +673,9 @@ internal void SyncVarUpdate()
673
673
}
674
674
}
675
675
676
- void invokeSyncvarMethodOnHost ( MethodInfo hookMethod )
676
+ private void InvokeSyncvarMethodOnServer ( MethodInfo hookMethod )
677
677
{
678
- if ( hookMethod != null && isHost )
678
+ if ( isServer && hookMethod != null )
679
679
hookMethod . Invoke ( this , null ) ;
680
680
}
681
681
0 commit comments