protected virtual void FinalizeLanding() { vehicle.CompVehicleLauncher.inFlight = false; if (VehicleReservationManager.AnyVehicleInhabitingCells(vehicle.PawnOccupiedCells(Position, Rotation), Map)) { GenExplosion.DoExplosion(Position, Map, Mathf.Max(vehicle.VehicleDef.Size.x, vehicle.VehicleDef.Size.z), DamageDefOf.Bomb, vehicle); } else { GenSpawn.Spawn(vehicle, Position, Map, Rotation); if (VehicleMod.settings.main.deployOnLanding) { vehicle.CompVehicleLauncher.SetTimedDeployment(); } } Destroy(); }
/// <summary> /// Vehicle is blocked at <paramref name="cell"/> and will not spawn correctly /// </summary> /// <param name="cell"></param> public static bool VehicleBlockedInPosition(VehiclePawn vehicle, Map map, IntVec3 cell, Rot4 rot) { IEnumerable <IntVec3> cells = vehicle.PawnOccupiedCells(cell, rot); return(VehicleReservationManager.AnyVehicleInhabitingCells(cells, map) || !vehicle.CellRectStandable(map, cell, rot)); }