Exemple #1
0
        public static bool PlayerAction_Build_CreatePrebuilds_Prefix(ref PlayerAction_Build __instance)
        {
            var runOriginal = true;

            if (__instance.waitConfirm && VFInput._buildConfirm.onDown && __instance.buildPreviews.Count > 0 &&
                MultiBuild.IsMultiBuildEnabled() && !__instance.multiLevelCovering)
            {
                if (MultiBuild.startPos == Vector3.zero)
                {
                    MultiBuild.startPos = __instance.groundSnappedPos;
                    lastPosition        = Vector3.zero;
                    runOriginal         = false;
                }
                else
                {
                    MultiBuild.startPos = Vector3.zero;
                    runOriginal         = true;
                }
            }
            if (__instance.waitConfirm && VFInput._buildConfirm.onDown && __instance.buildPreviews.Count > 1)
            {
                for (var i = 0; i < __instance.buildPreviews.Count; i++)
                {
                    var bp = __instance.buildPreviews[i];
                    if (bp.desc.isInserter && !IsInserterConnected(bp))
                    {
                        __instance.RemoveBuildPreview(bp);
                        --i;
                    }
                }
            }

            return(runOriginal);
        }
Exemple #2
0
        public static bool CreatePrebuilds_Prefix(ref PlayerAction_Build __instance)
        {
            if (__instance.waitConfirm && VFInput._buildConfirm.onDown && __instance.buildPreviews.Count > 0 &&
                MultiBuild.IsMultiBuildEnabled() && !__instance.multiLevelCovering)
            {
                if (MultiBuild.startPos == Vector3.zero)
                {
                    MultiBuild.startPos = __instance.groundSnappedPos;
                    return(false);
                }
                else
                {
                    MultiBuild.startPos = Vector3.zero;
                    return(true);
                }
            }

            return(true);
        }