|
@@ -115,11 +115,18 @@ namespace CommonAI.ZoneClient
|
|
|
ZoneLayer.s_active_object_count++;
|
|
|
this.IsLoaded = false;
|
|
|
this.DataRoot = dataroot;
|
|
|
- this.Templates = dataroot.Templates;
|
|
|
this.LayerClient = client;
|
|
|
this.ActorSyncMode = SyncMode.ForceByServer;
|
|
|
- this.AsyncUnitPosModifyMaxRange = Templates.CFG.CLIENT_UNIT_MOVE_MODIFY_MAX_RANGE;
|
|
|
- this.MinStep = MoveHelper.GetDistance(1000 / Templates.CFG.SYSTEM_FPS, Templates.CFG.OBJECT_MOVE_TO_MIN_STEP_SEC);
|
|
|
+ this.Templates = dataroot?.Templates;
|
|
|
+ if (Templates == null)
|
|
|
+ {
|
|
|
+ log.Error("dataroot cannot set to null");
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ this.AsyncUnitPosModifyMaxRange = Templates.CFG.CLIENT_UNIT_MOVE_MODIFY_MAX_RANGE;
|
|
|
+ this.MinStep = MoveHelper.GetDistance(1000 / Templates.CFG.SYSTEM_FPS, Templates.CFG.OBJECT_MOVE_TO_MIN_STEP_SEC);
|
|
|
+ }
|
|
|
}
|
|
|
//-------------------------------------------------------------------------------------------
|
|
|
~ZoneLayer()
|