Skip to content

Commit

Permalink
Fix damage types, ice monkey
Browse files Browse the repository at this point in the history
  • Loading branch information
doombubbles committed Oct 11, 2024
1 parent 6c8ca86 commit 0b5e372
Show file tree
Hide file tree
Showing 21 changed files with 21 additions and 3 deletions.
Binary file modified Bytes/BeastHandlers.bytes
Binary file not shown.
Binary file modified Bytes/BombShooters.bytes
Binary file not shown.
Binary file modified Bytes/BoomerangMonkeys.bytes
Binary file not shown.
Binary file modified Bytes/DartMonkeys.bytes
Binary file not shown.
Binary file modified Bytes/Druids.bytes
Binary file not shown.
Binary file modified Bytes/EngineerMonkeys.bytes
Binary file not shown.
Binary file modified Bytes/HeliPilots.bytes
Binary file not shown.
Binary file modified Bytes/IceMonkeys.bytes
Binary file not shown.
Binary file modified Bytes/MonkeyAces.bytes
Binary file not shown.
Binary file modified Bytes/MonkeyBuccaneers.bytes
Binary file not shown.
Binary file modified Bytes/MonkeySubs.bytes
Binary file not shown.
Binary file modified Bytes/MortarMonkeys.bytes
Binary file not shown.
Binary file modified Bytes/SniperMonkeys.bytes
Binary file not shown.
Binary file modified Bytes/SpikeFactorys.bytes
Binary file not shown.
Binary file modified Bytes/SuperMonkeys.bytes
Binary file not shown.
Binary file modified Bytes/TackShooters.bytes
Binary file not shown.
Binary file modified Bytes/WizardMonkeys.bytes
Binary file not shown.
3 changes: 2 additions & 1 deletion LATEST.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
## See the [BTD Mod Helper Install Guide](https://gurrenm3.github.io/BTD-Mod-Helper/wiki/Install-Guide) if this is your first time downloading, and the [Common Issues](https://github.com/doombubbles/ultimate-crosspathing/blob/1.4.5/HELP.md#common-issues) page for help
<!--Mod Browser Message Start-->
- Fixed for BTD6 v45
- Fixed damage types not being merged correctly in the last version
- Fixed error that could happen with Ice Monkey 5X5 crosspath
2 changes: 1 addition & 1 deletion Merging/Algorithm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -732,7 +732,7 @@ private static bool IsType<T>(this Type typ)
{
if (typeof(T).IsEnum)
{
return typ.FullName.StartsWith(typeof(T).FullName!);
return typeof(T).FullName!.EndsWith(typ.FullName!);
}
var ty = Il2CppType.From(typeof(T));
return ty.IsAssignableFrom(typ);
Expand Down
2 changes: 1 addition & 1 deletion ModHelperData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
public static class ModHelperData
{
public const string WorksOnVersion = "45.0";
public const string Version = "1.5.1";
public const string Version = "1.5.2";
public const string Name = "Ultimate Crosspathing";

public const string Description =
Expand Down
17 changes: 17 additions & 0 deletions Patches.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using Il2CppAssets.Scripts.Unity.UI_New.InGame.TowerSelectionMenu;
using HarmonyLib;
using Il2CppAssets.Scripts.Models.Towers;
using Il2CppAssets.Scripts.Simulation.Towers.Behaviors.Attack;

namespace UltimateCrosspathing
{
Expand Down Expand Up @@ -81,4 +82,20 @@ internal static void Postfix(Bank __instance)
}
}
}

/// <summary>
/// Fix bug where previous target suppliers that were since destroyed would sometimes still stick around
/// </summary>
[HarmonyPatch(typeof(Attack), nameof(Attack.UpdateActiveTargetSupplier))]
internal static class Attack_UpdateActiveTargetSupplier
{
[HarmonyPrefix]
internal static void Prefix(Attack __instance)
{
if (__instance.activeTargetSupplier is {IsDestroyed: true})
{
__instance.activeTargetSupplier = null;
}
}
}
}

0 comments on commit 0b5e372

Please sign in to comment.