예제 #1
0
        // This method is to fix region building for custom doors
        // which will fail for any class inheritting Building_Door
        internal static bool _CheckRegionableAndProcessNeighbor(IntVec3 c, Rot4 processingDirection)
        {
            if (!GenGrid.InBounds(c))
            {
                _RegionMaker._newReg.touchesMapEdge = true;
                return(false);
            }
            if (!c.Walkable())
            {
                return(false);
            }
            Thing regionBarrier = c.GetRegionBarrier();

            if (regionBarrier == null)
            {
                return(true);
            }
            if (
                (regionBarrier.def.thingClass == typeof(Building_Door)) ||
                (regionBarrier.def.thingClass.IsSubclassOf(typeof(Building_Door)))
                )
            {
                _TryMakePortalSpan.Invoke(null, new System.Object[] { c, processingDirection });
            }
            return(false);
        }