public static GameObject SpawnAtPlayer(string prefab, PlayerClient player, int count) { Vector3 vector; Vector3 vector2; IDMain idMain = player.controllable.idMain; Transform transform = idMain.transform; idMain.transform.GetGroundInfo(out vector, out vector2); Quaternion rotation = TransformHelpers.LookRotationForcedUp(player.transform.forward, vector2); return(Spawn(prefab, vector, rotation, count)); }
public static GameObject SpawnAtPlayer(string prefab, PlayerClient player, int count) { IDMain idMain = player.controllable.idMain; Transform transform = idMain.transform; Vector3 position; Vector3 up; idMain.transform.GetGroundInfo(out position, out up); Quaternion rotation = TransformHelpers.LookRotationForcedUp(player.transform.forward, up); return(World.Spawn(prefab, position, rotation, count)); }
public override void ProcessNetworkUpdate(ref Vector3 origin, ref Quaternion rotation) { Vector3 vector; Vector3 vector2; TransformHelpers.GetGroundInfo(origin + new Vector3(0f, 0.25f, 0f), 10f, out vector, out vector2); Vector3 from = (Vector3)(rotation * Vector3.up); float num = Vector3.Angle(from, vector2); if (num > 20f) { vector2 = Vector3.Slerp(from, vector2, 20f / num); } origin = vector; rotation = TransformHelpers.LookRotationForcedUp(rotation, vector2); }
public override void ProcessNetworkUpdate(ref Vector3 origin, ref Quaternion rotation) { Vector3 vector3; Vector3 vector31; TransformHelpers.GetGroundInfo(origin + new Vector3(0f, 0.25f, 0f), 10f, out vector3, out vector31); Vector3 vector32 = rotation * Vector3.up; float single = Vector3.Angle(vector32, vector31); if (single > 20f) { vector31 = Vector3.Slerp(vector32, vector31, 20f / single); } origin = vector3; rotation = TransformHelpers.LookRotationForcedUp(rotation, vector31); }
public GameObject SpawnGeneric(Spawns.SpawnerGeneric.SpawnInstance instance) { Vector3 startPos = this.Position + UnityEngine.Random.insideUnitSphere * this.SpawnRadius; startPos.y = this.Position.y; Quaternion quaternion = Quaternion.Euler(new Vector3(0f, (float)UnityEngine.Random.Range(0, 360), 0f)); Vector3 vector; if (instance.UseNavmeshSample && TransformHelpers.GetGroundInfoNavMesh(startPos, out vector, 15f, -1)) { startPos = vector; } Vector3 up; GameObject result; if (TransformHelpers.GetGroundInfoTerrainOnly(startPos, 300f, out vector, out up)) { vector.y += 0.05f; if (instance.PrefabName == "BoxLoot") { vector.y += 0.35f; } quaternion = TransformHelpers.LookRotationForcedUp(quaternion * Vector3.forward, up); GameObject gameObject; if (!instance.StaticInstantiate && !instance.PrefabName.StartsWith(";")) { gameObject = NetCull.InstantiateDynamic(instance.PrefabName, vector, quaternion); } else { gameObject = NetCull.InstantiateStatic(instance.PrefabName, vector, quaternion); } if (gameObject != null) { instance.Spawned.Add(gameObject); } result = gameObject; } else { result = null; } return(result); }
protected void OnClientDeath(ref Vector3 deathPosition, uLink.NetworkViewID attackerNetViewID, ref uLink.NetworkMessageInfo info) { Vector3 vector; Vector3 vector2; TransformHelpers.GetGroundInfo(deathPosition + new Vector3(0f, 0.25f, 0f), 10f, out vector, out vector2); deathPosition = vector; Quaternion rot = TransformHelpers.LookRotationForcedUp((Vector3)(this._myTransform.rotation * Vector3.forward), vector2); this._interp.SetGoals(deathPosition, rot, info.timestamp); if (attackerNetViewID.isMine) { this.DoClientDeath(); } else { InterpTimedEvent.Queue(this, "DEATH", ref info); } }
public static Quaternion GetGroundInfoRotation(Quaternion ang, Vector3 y) { Vector3 vector3 = new Vector3(); Vector3 vector31 = new Vector3(); float single = y.magnitude; if (Mathf.Approximately(single, 0f)) { y = Vector3.up; single = 0f; } float single1 = 0f; float single2 = single1; vector3.y = single1; float single3 = single2; single2 = single3; vector3.x = single3; float single4 = single2; single2 = single4; vector31.z = single4; vector31.y = single2; float single5 = single; single2 = single5; vector3.z = single5; vector31.x = single2; vector31 = ang * vector31; vector3 = ang * vector3; float single6 = vector3.x * y.x + vector3.y * y.y + vector3.z * y.z; float single7 = vector31.x * y.x + vector31.y * y.y + vector31.z * y.z; if (single6 * single6 > single7 * single7) { return(TransformHelpers.LookRotationForcedUp(vector31, y)); } return(TransformHelpers.LookRotationForcedUp(vector3, y)); }
protected void RenderPlacementHelpers() { StructureComponent structureToPlacePrefab = base.datablock.structureToPlacePrefab; this._master = null; this._placePos = Vector3.zero; this._placeRot = Quaternion.identity; this.validLocation = false; float axis = Input.GetAxis("Mouse ScrollWheel"); if (axis > 0f) { this.desiredRotation *= Quaternion.AngleAxis(90f, Vector3.up); } else if (axis < 0f) { this.desiredRotation *= Quaternion.AngleAxis(-90f, Vector3.up); } Character character = base.character; if (character != null) { RaycastHit hit; Ray eyesRay = character.eyesRay; float distance = (structureToPlacePrefab.type != StructureComponent.StructureComponentType.Ceiling) ? 8f : 4f; Vector3 zero = Vector3.zero; Vector3 up = Vector3.up; Vector3 vector3 = Vector3.zero; bool flag = false; if (Physics.Raycast(eyesRay, out hit, distance)) { vector3 = zero = hit.point; up = hit.normal; flag = true; } else { flag = false; vector3 = zero = eyesRay.origin + ((Vector3)(eyesRay.direction * distance)); } switch (structureToPlacePrefab.type) { case StructureComponent.StructureComponentType.Ceiling: case StructureComponent.StructureComponentType.Foundation: case StructureComponent.StructureComponentType.Ramp: zero.y -= 3.5f; break; } bool flag2 = false; bool flag3 = false; Vector3 vector4 = zero; Quaternion quaternion = TransformHelpers.LookRotationForcedUp(character.eyesAngles.forward, Vector3.up) * this.desiredRotation; foreach (StructureMaster master in StructureMaster.RayTestStructures(eyesRay)) { if (master != null) { int num4; int num5; int num6; master.GetStructureSize(out num4, out num5, out num6); this._placePos = StructureMaster.SnapToGrid(master.transform, zero, true); this._placeRot = TransformHelpers.LookRotationForcedUp(master.transform.forward, master.transform.transform.up) * this.desiredRotation; if (!flag3) { vector4 = this._placePos; quaternion = this._placeRot; flag3 = true; } if (structureToPlacePrefab.CheckLocation(master, this._placePos, this._placeRot)) { this._master = master; flag2 = true; break; } } } if (flag2) { this.validLocation = true; } else if (structureToPlacePrefab.type != StructureComponent.StructureComponentType.Foundation) { this._placePos = vector4; this._placeRot = quaternion; this.validLocation = false; } else if (!flag || !(hit.collider is TerrainCollider)) { this._placePos = vector4; this._placeRot = quaternion; this.validLocation = false; } else { bool flag4 = false; foreach (StructureMaster master2 in StructureMaster.AllStructuresWithBounds) { if (master2.containedBounds.Intersects(new Bounds(zero, new Vector3(5f, 5f, 4f)))) { flag4 = true; break; } } if (!flag4) { this._placePos = zero; this._placeRot = TransformHelpers.LookRotationForcedUp(character.eyesAngles.forward, Vector3.up) * this.desiredRotation; this.validLocation = true; } } if (!base.datablock.CheckBlockers(this._placePos)) { this.validLocation = false; } Color red = Color.red; if (this.validLocation) { red = Color.green; } red.a = 0.5f + (Mathf.Abs(Mathf.Sin(Time.time * 8f)) * 0.25f); if (this._materialProps != null) { this._materialProps.Clear(); this._materialProps.AddColor("_EmissionColor", red); this._materialProps.AddVector("_MainTex_ST", new Vector4(1f, 1f, 0f, Mathf.Repeat(Time.time, 30f))); } if (!this.validLocation) { this._placePos = zero; } this.RenderDeployPreview(this._placePos, this._placeRot); } }
public void CheckPlacementResults(Ray ray, out Vector3 pos, out Quaternion rot, out TransCarrier carrier, out DeployPlaceResults results) { RaycastHit hit; Vector3 position; Vector3 normal; bool flag6; MeshBatchInstance instance; Quaternion rotation; float placeRange = this.placeRange; IDMain main = null; bool flag = false; bool flag2 = false; bool flag3 = false; DeployableObject obj2 = null; bool flag4 = false; bool flag5 = false; bool flag7 = this.minCastRadius >= float.Epsilon; bool flag8 = !flag7?MeshBatchPhysics.Raycast(ray, out hit, placeRange, -472317957, out flag6, out instance) : MeshBatchPhysics.SphereCast(ray, this.minCastRadius, out hit, placeRange, -472317957, out flag6, out instance); Vector3 point = ray.GetPoint(placeRange); if (!flag8) { Vector3 origin = point; origin.y += 0.5f; flag4 = MeshBatchPhysics.Raycast(origin, Vector3.down, out hit, 5f, -472317957, out flag6, out instance); } if (flag8 || flag4) { main = !flag6?IDBase.GetMain(hit.collider) : instance.idMain; flag3 = (main is StructureComponent) || (main is StructureMaster); position = hit.point; normal = hit.normal; flag = !flag3 && ((bool)(obj2 = main as DeployableObject)); if (((this.carrierSphereCastMode != CarrierSphereCastMode.Allowed) && flag8) && (flag7 && !NonVariantSphereCast(ray, position))) { Ray ray2; float num2; RaycastHit hit2; bool flag9; MeshBatchInstance instance2; bool flag10; if (this.carrierSphereCastMode == CarrierSphereCastMode.AdjustedRay) { Vector3 vector5 = ray.origin; Vector3 direction = hit.point - vector5; num2 = direction.magnitude + (this.minCastRadius * 2f); ray2 = new Ray(vector5, direction); Debug.DrawLine(ray.origin, ray.GetPoint(num2), Color.cyan); } else { num2 = placeRange + this.minCastRadius; ray2 = ray; } if (!(flag10 = MeshBatchPhysics.Raycast(ray2, out hit2, num2, -472317957, out flag9, out instance2))) { Vector3 vector8 = position; vector8.y += 0.5f; flag10 = MeshBatchPhysics.Raycast(vector8, Vector3.down, out hit2, 5f, -472317957, out flag9, out instance2); } if (flag10) { IDMain main2 = !flag9?IDBase.GetMain(hit2.collider) : instance2.idMain; carrier = (main2 == null) ? hit2.collider.GetComponent <TransCarrier>() : main2.GetLocal <TransCarrier>(); } else { carrier = null; } } else { carrier = ((main == null) ? hit.collider.gameObject : main.gameObject).GetComponent <TransCarrier>(); } flag2 = (hit.collider is TerrainCollider) || (hit.collider.gameObject.layer == 10); flag5 = true; } else { position = point; normal = Vector3.up; carrier = null; } bool flag11 = false; Hardpoint hardpointFromRay = null; if (this.hardpointType != Hardpoint.hardpoint_type.None) { hardpointFromRay = Hardpoint.GetHardpointFromRay(ray, this.hardpointType); if (hardpointFromRay != null) { flag11 = true; position = hardpointFromRay.transform.position; normal = hardpointFromRay.transform.up; carrier = hardpointFromRay.GetMaster().GetTransCarrier(); flag5 = true; } } bool flag12 = false; if (this.spacingRadius > 0f) { foreach (Collider collider in Physics.OverlapSphere(position, this.spacingRadius)) { GameObject gameObject = collider.gameObject; IDBase component = collider.gameObject.GetComponent <IDBase>(); if (component != null) { gameObject = component.idMain.gameObject; } if (gameObject.CompareTag(this.ObjectToPlace.gameObject.tag) && (Vector3.Distance(position, gameObject.transform.position) < this.spacingRadius)) { flag12 = true; break; } } } bool flag13 = false; if ((flag && !this.forcePlaceable) && obj2.cantPlaceOn) { flag13 = true; } pos = position; if (this.orientationMode == DeployableOrientationMode.Default) { if (this.uprightOnly) { this.orientationMode = DeployableOrientationMode.Upright; } else { this.orientationMode = DeployableOrientationMode.NormalUp; } } switch (this.orientationMode) { case DeployableOrientationMode.NormalUp: rotation = TransformHelpers.LookRotationForcedUp(ray.direction, normal); break; case DeployableOrientationMode.Upright: rotation = TransformHelpers.LookRotationForcedUp(ray.direction, Vector3.up); break; case DeployableOrientationMode.NormalForward: rotation = TransformHelpers.LookRotationForcedUp(Vector3.Cross(ray.direction, Vector3.up), normal); break; case DeployableOrientationMode.HardpointPosRot: if (!flag11) { rotation = TransformHelpers.LookRotationForcedUp(ray.direction, Vector3.up); break; } rotation = hardpointFromRay.transform.rotation; break; default: throw new NotImplementedException(); } rot = rotation * this.ObjectToPlace.transform.localRotation; bool flag14 = false; if (this.checkPlacementZones) { flag14 = NoPlacementZone.ValidPos(pos); } float num4 = Vector3.Angle(normal, Vector3.up); results.falseFromDeployable = (!this.CanStackOnDeployables && flag) || flag13; results.falseFromTerrian = this.TerrainOnly && !flag2; results.falseFromClose = (this.spacingRadius > 0f) && flag12; results.falseFromHardpoint = this.requireHardpoint && !flag11; results.falseFromAngle = !this.requireHardpoint && (num4 >= this.ObjectToPlace.maxSlope); results.falseFromPlacementZone = this.checkPlacementZones && !flag14; results.falseFromHittingNothing = !flag5; results.falseFromStructure = this.StructureOnly && !flag3; results.falseFromFitRequirements = (this.fitRequirements != null) && !this.fitRequirements.Test(pos, !this.fitTestForcedUp ? rot : TransformHelpers.LookRotationForcedUp(rot, Vector3.up), this.ObjectToPlace.transform.localScale); }
protected void RenderPlacementHelpers() { RaycastHit raycastHit; int num; int num1; int num2; StructureComponent structureComponent = this.datablock.structureToPlacePrefab; this._master = null; this._placePos = Vector3.zero; this._placeRot = Quaternion.identity; this.validLocation = false; float axis = Input.GetAxis("Mouse ScrollWheel"); if (axis > 0f) { this.desiredRotation = this.desiredRotation * Quaternion.AngleAxis(90f, Vector3.up); } else if (axis < 0f) { this.desiredRotation = this.desiredRotation * Quaternion.AngleAxis(-90f, Vector3.up); } Character character = base.character; if (character == null) { return; } Ray ray = character.eyesRay; float single = (structureComponent.type != StructureComponent.StructureComponentType.Ceiling ? 8f : 4f); Vector3 vector3 = Vector3.zero; Vector3 vector31 = Vector3.up; Vector3 vector32 = Vector3.zero; bool flag = false; if (!Physics.Raycast(ray, out raycastHit, single)) { flag = false; Vector3 vector33 = ray.origin + (ray.direction * single); vector3 = vector33; vector32 = vector33; } else { Vector3 vector34 = raycastHit.point; vector3 = vector34; vector32 = vector34; vector31 = raycastHit.normal; flag = true; } switch (structureComponent.type) { case StructureComponent.StructureComponentType.Ceiling: case StructureComponent.StructureComponentType.Foundation: case StructureComponent.StructureComponentType.Ramp: { vector3.y = vector3.y - 3.5f; goto case StructureComponent.StructureComponentType.WindowWall; } case StructureComponent.StructureComponentType.Stairs: case StructureComponent.StructureComponentType.WindowWall: { bool flag1 = false; bool flag2 = false; Vector3 vector35 = vector3; Angle2 angle2 = character.eyesAngles; Quaternion quaternion = TransformHelpers.LookRotationForcedUp(angle2.forward, Vector3.up) * this.desiredRotation; StructureMaster[] structureMasterArray = StructureMaster.RayTestStructures(ray); for (int i = 0; i < (int)structureMasterArray.Length; i++) { StructureMaster structureMaster = structureMasterArray[i]; if (structureMaster) { structureMaster.GetStructureSize(out num, out num1, out num2); this._placePos = StructureMaster.SnapToGrid(structureMaster.transform, vector3, true); this._placeRot = TransformHelpers.LookRotationForcedUp(structureMaster.transform.forward, structureMaster.transform.transform.up) * this.desiredRotation; if (!flag2) { vector35 = this._placePos; quaternion = this._placeRot; flag2 = true; } if (structureComponent.CheckLocation(structureMaster, this._placePos, this._placeRot)) { this._master = structureMaster; flag1 = true; break; } } } if (flag1) { this.validLocation = true; } else if (structureComponent.type != StructureComponent.StructureComponentType.Foundation) { this._placePos = vector35; this._placeRot = quaternion; this.validLocation = false; } else if (!flag || !(raycastHit.collider is TerrainCollider)) { this._placePos = vector35; this._placeRot = quaternion; this.validLocation = false; } else { bool flag3 = false; foreach (StructureMaster allStructuresWithBound in StructureMaster.AllStructuresWithBounds) { if (!allStructuresWithBound.containedBounds.Intersects(new Bounds(vector3, new Vector3(5f, 5f, 4f)))) { continue; } flag3 = true; break; } if (!flag3) { this._placePos = vector3; Angle2 angle21 = character.eyesAngles; this._placeRot = TransformHelpers.LookRotationForcedUp(angle21.forward, Vector3.up) * this.desiredRotation; this.validLocation = true; } } if (!this.datablock.CheckBlockers(this._placePos)) { this.validLocation = false; } Color color = Color.red; if (this.validLocation) { color = Color.green; } color.a = 0.5f + Mathf.Abs(Mathf.Sin(Time.time * 8f)) * 0.25f; if (this._materialProps != null) { this._materialProps.Clear(); this._materialProps.AddColor("_EmissionColor", color); this._materialProps.AddVector("_MainTex_ST", new Vector4(1f, 1f, 0f, Mathf.Repeat(Time.time, 30f))); } if (!this.validLocation) { this._placePos = vector3; } this.RenderDeployPreview(this._placePos, this._placeRot); return; } default: { goto case StructureComponent.StructureComponentType.WindowWall; } } }
public void CheckPlacementResults(Ray ray, out Vector3 pos, out Quaternion rot, out TransCarrier carrier, out DeployableItemDataBlock.DeployPlaceResults results) { results = new DeployableItemDataBlock.DeployPlaceResults(); RaycastHit raycastHit; Vector3 vector3; Vector3 vector31; bool flag; MeshBatchInstance meshBatchInstance; Ray ray1; float single; RaycastHit raycastHit1; bool flag1; MeshBatchInstance meshBatchInstance1; Quaternion quaternion; bool flag2; float single1 = this.placeRange; IDMain dMain = null; bool flag3 = false; bool flag4 = false; bool flag5 = false; DeployableObject deployableObject = null; bool flag6 = false; bool flag7 = false; bool flag8 = this.minCastRadius >= 1.401298E-45f; bool flag9 = (!flag8 ? Facepunch.MeshBatch.MeshBatchPhysics.Raycast(ray, out raycastHit, single1, -472317957, out flag, out meshBatchInstance) : Facepunch.MeshBatch.MeshBatchPhysics.SphereCast(ray, this.minCastRadius, out raycastHit, single1, -472317957, out flag, out meshBatchInstance)); Vector3 point = ray.GetPoint(single1); if (!flag9) { Vector3 vector32 = point; vector32.y = vector32.y + 0.5f; flag6 = Facepunch.MeshBatch.MeshBatchPhysics.Raycast(vector32, Vector3.down, out raycastHit, 5f, -472317957, out flag, out meshBatchInstance); } if (flag9 || flag6) { dMain = (!flag ? IDBase.GetMain(raycastHit.collider) : meshBatchInstance.idMain); flag5 = (dMain is StructureComponent ? true : dMain is StructureMaster); vector3 = raycastHit.point; vector31 = raycastHit.normal; if (flag5) { flag2 = false; } else { DeployableObject deployableObject1 = dMain as DeployableObject; deployableObject = deployableObject1; flag2 = deployableObject1; } flag3 = flag2; if (this.carrierSphereCastMode == DeployableItemDataBlock.CarrierSphereCastMode.Allowed || !flag9 || !flag8 || DeployableItemDataBlock.NonVariantSphereCast(ray, vector3)) { carrier = ((!dMain ? raycastHit.collider.gameObject : dMain.gameObject)).GetComponent <TransCarrier>(); } else { if (this.carrierSphereCastMode != DeployableItemDataBlock.CarrierSphereCastMode.AdjustedRay) { single = single1 + this.minCastRadius; ray1 = ray; } else { Vector3 vector33 = ray.origin; Vector3 vector34 = raycastHit.point - vector33; single = vector34.magnitude + this.minCastRadius * 2f; ray1 = new Ray(vector33, vector34); Debug.DrawLine(ray.origin, ray.GetPoint(single), Color.cyan); } bool flag10 = Facepunch.MeshBatch.MeshBatchPhysics.Raycast(ray1, out raycastHit1, single, -472317957, out flag1, out meshBatchInstance1); bool flag11 = flag10; if (!flag10) { Vector3 vector35 = vector3; vector35.y = vector35.y + 0.5f; flag11 = Facepunch.MeshBatch.MeshBatchPhysics.Raycast(vector35, Vector3.down, out raycastHit1, 5f, -472317957, out flag1, out meshBatchInstance1); } if (!flag11) { carrier = null; } else { IDMain dMain1 = (!flag1 ? IDBase.GetMain(raycastHit1.collider) : meshBatchInstance1.idMain); carrier = (!dMain1 ? raycastHit1.collider.GetComponent <TransCarrier>() : dMain1.GetLocal <TransCarrier>()); } } flag4 = (raycastHit.collider is TerrainCollider ? true : raycastHit.collider.gameObject.layer == 10); flag7 = true; } else { vector3 = point; vector31 = Vector3.up; carrier = null; } bool flag12 = false; Hardpoint hardpointFromRay = null; if (this.hardpointType != Hardpoint.hardpoint_type.None) { hardpointFromRay = Hardpoint.GetHardpointFromRay(ray, this.hardpointType); if (hardpointFromRay) { flag12 = true; vector3 = hardpointFromRay.transform.position; vector31 = hardpointFromRay.transform.up; carrier = hardpointFromRay.GetMaster().GetTransCarrier(); flag7 = true; } } bool flag13 = false; if (this.spacingRadius > 0f) { Collider[] colliderArray = Physics.OverlapSphere(vector3, this.spacingRadius); int num = 0; while (num < (int)colliderArray.Length) { Collider collider = colliderArray[num]; GameObject gameObject = collider.gameObject; IDBase component = collider.gameObject.GetComponent <IDBase>(); if (component != null) { gameObject = component.idMain.gameObject; } if (!gameObject.CompareTag(this.ObjectToPlace.gameObject.tag) || Vector3.Distance(vector3, gameObject.transform.position) >= this.spacingRadius) { num++; } else { flag13 = true; break; } } } bool flag14 = false; if (flag3 && !this.forcePlaceable && deployableObject.cantPlaceOn) { flag14 = true; } pos = vector3; if (this.orientationMode == DeployableOrientationMode.Default) { if (!this.uprightOnly) { this.orientationMode = DeployableOrientationMode.NormalUp; } else { this.orientationMode = DeployableOrientationMode.Upright; } } switch (this.orientationMode) { case DeployableOrientationMode.NormalUp: { quaternion = TransformHelpers.LookRotationForcedUp(ray.direction, vector31); break; } case DeployableOrientationMode.Upright: { quaternion = TransformHelpers.LookRotationForcedUp(ray.direction, Vector3.up); break; } case DeployableOrientationMode.NormalForward: { Vector3 vector36 = Vector3.Cross(ray.direction, Vector3.up); quaternion = TransformHelpers.LookRotationForcedUp(vector36, vector31); break; } case DeployableOrientationMode.HardpointPosRot: { quaternion = (!flag12 ? TransformHelpers.LookRotationForcedUp(ray.direction, Vector3.up) : hardpointFromRay.transform.rotation); break; } default: { throw new NotImplementedException(); } } rot = quaternion * this.ObjectToPlace.transform.localRotation; bool flag15 = false; if (this.checkPlacementZones) { flag15 = NoPlacementZone.ValidPos(pos); } float single2 = Vector3.Angle(vector31, Vector3.up); results.falseFromDeployable = (this.CanStackOnDeployables || !flag3 ? flag14 : true); results.falseFromTerrian = (!this.TerrainOnly ? false : !flag4); results.falseFromClose = (this.spacingRadius <= 0f ? false : flag13); results.falseFromHardpoint = (!this.requireHardpoint ? false : !flag12); results.falseFromAngle = (this.requireHardpoint ? false : single2 >= this.ObjectToPlace.maxSlope); results.falseFromPlacementZone = (!this.checkPlacementZones ? false : !flag15); results.falseFromHittingNothing = !flag7; results.falseFromStructure = (!this.StructureOnly ? false : !flag5); results.falseFromFitRequirements = (this.fitRequirements == null ? false : !this.fitRequirements.Test(pos, (!this.fitTestForcedUp ? rot : TransformHelpers.LookRotationForcedUp(rot, Vector3.up)), this.ObjectToPlace.transform.localScale)); }