Пример #1
0
        public override void UpdateCell(int cell, NavTable nav_table, CellOffset[] bounding_offsets)
        {
            bool flag = ScaffoldingValidator.IsWalkableCell(cell);

            if (flag && base.IsClear(cell, bounding_offsets, false))
            {
                nav_table.SetValid(cell, NavType.Floor, true);
            }
        }
Пример #2
0
        /// <summary>
        /// GameNavGrids.SwimValidator.UpdateCell Prefix
        /// </summary>
        static bool Prefix(GameNavGrids.SwimValidator __instance, int cell, NavTable nav_table, CellOffset[] bounding_offsets)
        {
            bool?isClear = SwimValidatorHelper.NavTableValidator_IsClear(__instance, cell, bounding_offsets, false);

            if (!isClear.HasValue) // failed to access base method
            {
                return(true);      // skip patch and call original method
            }
            bool is_swimmable = Grid.IsWorldValidCell(cell) && (Grid.IsSubstantialLiquid(cell, 0.9f) || (Grid.IsLiquid(cell) && (SwimValidatorHelper.IsLiquidAbove(cell) || SwimValidatorHelper.IsLiquidBelow(cell)))) && isClear.Value;

            nav_table.SetValid(cell, NavType.Swim, is_swimmable);

            return(false); // skip execution of the original method
        }