Exemple #1
0
 static void Postfix(ThingDef plantDef, Map map, ref bool __result)
 {
     if (__result)
     {
         if (plantDef.HasModExtension <ZTB_AllowedRange>())
         {
             ZTB_AllowedRange allowedRange = plantDef.GetModExtension <ZTB_AllowedRange>();
             __result = allowedRange.IsAllowedIn(map);
         }
     }
 }
Exemple #2
0
        static bool Prefix(ref bool __result, ThingDef plantDef, IntVec3 c, Map map)
        {
            if (plantDef.HasModExtension <ZTB_AllowedRange>())
            {
                ZTB_AllowedRange allowedRange = plantDef.GetModExtension <ZTB_AllowedRange>();
                __result = allowedRange.IsAllowedIn(map);

                // This is intentional. If this filter allows the plant, the parent method still needs to run.
                return(__result);
            }

            return(true);
        }