Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 19 additions & 17 deletions Source/1.5/HarmonyPatches.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4517,9 +4517,24 @@ public static class VFShuttleBayLaunch
{
public static void Postfix(ref string disableReason, CompVehicleLauncher __instance, ref bool __result)
{
if (disableReason != Translator.Translate("CommandLaunchGroupFailUnderRoof")) return;
//Temporary fix clarifying the message on shuttle unable to launch because of rotated
if (disableReason == "VF_CannotLaunchImmobile".Translate(__instance.Vehicle.LabelShort) && __instance.Vehicle.Angle != 0)
{
disableReason = "VF_Fix_CannotLaunchRotated".Translate(__instance.Vehicle.LabelShort);
}

// Somwehow, was allowed to launch overloaded.
VehiclePawn vehiclePawn = (VehiclePawn)__instance.parent;
float vehicleCapacity = vehiclePawn.GetStatValue(VehicleStatDefOf.CargoCapacity);
if (MassUtility.InventoryMass(vehiclePawn) > vehicleCapacity)
{
disableReason = "VF_CannotLaunchOverEncumbered".Translate(vehiclePawn.LabelShort);
__result = false;
return;
}

if (disableReason != Translator.Translate("CommandLaunchGroupFailUnderRoof")) return;

VehiclePawn vehiclePawn = (VehiclePawn) __instance.parent;
Map map = vehiclePawn.Map;
IntVec3 cell = vehiclePawn.Position;

Expand Down Expand Up @@ -4800,21 +4815,8 @@ public static bool Prefix()
//__result.AddRange(aerialVehicle.vehicle.AllPawnsAboard);
}
return false;
}
}

[HarmonyPatch(typeof(CompVehicleLauncher), "CanLaunchWithCargoCapacity")]
public static class RotatedLaunchWarningFix
{
//Temporary fix clarifying the message on shuttle unable to launch
public static void Postfix(CompVehicleLauncher __instance, ref string disableReason)
{
if( disableReason == "VF_CannotLaunchImmobile".Translate(__instance.Vehicle.LabelShort) && __instance.Vehicle.Angle != 0)
{
disableReason = "VF_Fix_CannotLaunchRotated".Translate(__instance.Vehicle.LabelShort);
}
}
}
}
}

[HarmonyPatch(typeof(CompUpgradeTree), "ValidateListers")]
public static class DisableValidateListersOffMap
Expand Down