Fixed Abyss/Subworld Library problems
This commit is contained in:
1 parent
c8909e92a4
commit
8dc7ea7c94
3 files changed
+25
No files matched your search
@@ -32,6 +32,10 @@ namespace CalamityMod.BiomeManagers
|
||||
}
|
||||
|
||||
playerYTileCoords = point.Y;
|
||||
|
||||
if (WeakReferenceSupport.InAnySubworld())
|
||||
return false;
|
||||
|
||||
return point.Y > (Main.rockLayer - y * 0.05) &&
|
||||
!player.lavaWet &&
|
||||
!player.honeyWet &&
|
||||
|
||||
@@ -131,6 +131,7 @@ namespace CalamityMod
|
||||
internal Mod summonersAssociation = null;
|
||||
internal Mod thorium = null;
|
||||
internal Mod varia = null;
|
||||
internal Mod subworldLibrary = null;
|
||||
|
||||
#region Load
|
||||
public override void Load()
|
||||
@@ -172,6 +173,8 @@ namespace CalamityMod
|
||||
ModLoader.TryGetMod("ThoriumMod", out thorium);
|
||||
varia = null;
|
||||
ModLoader.TryGetMod("Varia", out varia);
|
||||
subworldLibrary = null;
|
||||
ModLoader.TryGetMod("SubworldLibrary", out subworldLibrary);
|
||||
|
||||
// Initialize the EnemyStats struct as early as it is safe to do so
|
||||
NPCStats.Load();
|
||||
|
||||
@@ -213,6 +213,24 @@ namespace CalamityMod
|
||||
// Wrapper function to add summon items to other mods' bosses for Boss Checklist.
|
||||
private static void AddSummons(Mod bossChecklist, string mod, string bossName, List<int> summons) => bossChecklist.Call("AddToBossSpawnItems", mod, bossName, summons);
|
||||
|
||||
// Wrapper function to detect if a subworld is in use for Subworld Library.
|
||||
internal static bool InAnySubworld()
|
||||
{
|
||||
if (CalamityMod.Instance.subworldLibrary is null)
|
||||
return false;
|
||||
|
||||
foreach (Mod mod in ModLoader.Mods)
|
||||
{
|
||||
if (mod.Name.Equals(CalamityMod.Instance.subworldLibrary.Name))
|
||||
continue;
|
||||
|
||||
bool anySubworldForMod = (CalamityMod.Instance.subworldLibrary.Call("AnyActive", mod) as bool?) ?? false;
|
||||
if (anySubworldForMod)
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 1.0 = King Slime<br />
|
||||
/// 2.0 = Eye of Cthulhu<br />
|
||||
|
||||
Reference in new issue
Block a user