public void CheckMerge(DecayEntity ent) { if (ent.buildingID == 0) { return; } BuildingManager.Building building1 = ent.GetBuilding(); if (building1 == null) { return; } ent.EntityLinkMessage <BuildingBlock>((BuildingBlock b) => { if (b.buildingID != building1.ID) { BuildingManager.Building building = b.GetBuilding(); if (building != null) { this.Merge(building1, building); } } }); if (AI.nav_carve_use_building_optimization) { building1.isNavMeshCarvingDirty = true; int num = 2; this.UpdateNavMeshCarver(building1, ref num, 0); } }
public void CheckMerge(DecayEntity ent) { if (ent.buildingID == 0U) { return; } BuildingManager.Building building = ent.GetBuilding(); if (building == null) { return; } ent.EntityLinkMessage <BuildingBlock>((Action <BuildingBlock>)(b => { if ((int)b.buildingID == (int)building.ID) { return; } BuildingManager.Building building1 = b.GetBuilding(); if (building1 == null) { return; } this.Merge(building, building1); })); if (!ConVar.AI.nav_carve_use_building_optimization) { return; } building.isNavMeshCarvingDirty = true; int ticks = 2; this.UpdateNavMeshCarver(building, ref ticks, 0); }