Skip to content

Commit

Permalink
Fixed issue with Old Wars WarpDrive not updating the range for nonHosts
Browse files Browse the repository at this point in the history
  • Loading branch information
pokegustavor committed Jan 19, 2023
1 parent de748e7 commit a687a7f
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,12 @@ public int GetWarpDriveIDFromName(string WarpDriveName)
}
return -1;
}
public static PLWarpDrive CreateWarpDrive(int Subtype, int level)
public static PLWarpDrive CreateWarpDrive(int Subtype, int level, short SubTypeData)
{
PLWarpDrive InWarpDrive;
if (Subtype >= Instance.VanillaWarpDriveMaxType)
{
InWarpDrive = new PLWarpDrive(EWarpDriveType.E_MAX, level);
InWarpDrive = new PLWarpDrive(EWarpDriveType.E_MAX, level, SubTypeData);
int subtypeformodded = Subtype - Instance.VanillaWarpDriveMaxType;
if (subtypeformodded <= Instance.WarpDriveTypes.Count && subtypeformodded > -1)
{
Expand All @@ -97,7 +97,7 @@ public static PLWarpDrive CreateWarpDrive(int Subtype, int level)
}
else
{
InWarpDrive = new PLWarpDrive((EWarpDriveType)Subtype, level);
InWarpDrive = new PLWarpDrive((EWarpDriveType)Subtype, level,SubTypeData);
}
return InWarpDrive;
}
Expand All @@ -106,9 +106,9 @@ public static PLWarpDrive CreateWarpDrive(int Subtype, int level)
[HarmonyPatch(typeof(PLWarpDrive), "CreateWarpDriveFromHash")]
class WarpDriveHashFix
{
static bool Prefix(int inSubType, int inLevel, ref PLShipComponent __result)
static bool Prefix(int inSubType, int inLevel, short inSubTypeData, ref PLShipComponent __result)
{
__result = WarpDriveModManager.CreateWarpDrive(inSubType, inLevel);
__result = WarpDriveModManager.CreateWarpDrive(inSubType, inLevel, inSubTypeData);
return false;
}
}
Expand Down

0 comments on commit a687a7f

Please sign in to comment.