diff --git a/CHANGELOG.md b/CHANGELOG.md index d8a7890a..4c6df366 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -67,6 +67,7 @@ Putting this stuff down here so things don't conflict as often. * Removed `TShock.CheckProjectilePermission` and replaced it with `TSPlayer.HasProjectilePermission` and `TSPlayer.LacksProjectilePermission` respectively. (@hakusaro) * Added `TSPlayer` object to `GetDataHandlers.LiquidSetEventArgs`. (@hakusaro) * Removed `TShock.StartInvasion` for public use (moved to Utils and marked internal). (@hakusaro) +* Fixed invasions started by TShock not reporting size correctly and probably not working at all. (@hakusaro) ## TShock 4.3.25 * Fixed a critical exploit in the Terraria protocol that could cause massive unpreventable world corruption as well as a number of other problems. Thanks to @bartico6 for reporting. Fixed by the efforts of @QuiCM, @hakusaro, and tips in the right directioon from @bartico6. diff --git a/TShockAPI/Utils.cs b/TShockAPI/Utils.cs index f831a249..b27bee5d 100644 --- a/TShockAPI/Utils.cs +++ b/TShockAPI/Utils.cs @@ -1465,6 +1465,7 @@ namespace TShockAPI if (TShock.Config.InfiniteInvasion) { + // Not really an infinite size invasionSize = 20000000; } else @@ -1472,10 +1473,15 @@ namespace TShockAPI invasionSize = 100 + (TShock.Config.InvasionMultiplier * ActivePlayers()); } - // Note: This is a workaround to previously providing the size as a parameter in StartInvasion - Main.invasionSize = invasionSize; + // Order matters + // StartInvasion will reset the invasion size Main.StartInvasion(type); + + // Note: This is a workaround to previously providing the size as a parameter in StartInvasion + // Have to set start size to report progress correctly + Main.invasionSizeStart = invasionSize; + Main.invasionSize = invasionSize; } /// Verifies that each stack in each chest is valid and not over the max stack count.