(Probably) fix invasions started by TShock being weird
TShock used to call the StartInvasion method in Main with a type and a size, but then in some update it stopped taking a size. So you have to change a field to change the size, but the problem is that the field is reset when StartInavsion is called. This means that any effort to manually change the size would have failed due to the fact that the field is reset at the end. The order has been changed to account for this. In addition, the start size is now set, so the game can report progress correctly on the current invasion.
This commit is contained in:
parent
3f22c52698
commit
5f647f087c
2 changed files with 9 additions and 2 deletions
|
|
@ -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.
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
||||
/// <summary>Verifies that each stack in each chest is valid and not over the max stack count.</summary>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue