Refactored StartInvasions to use Main.startInvasion method
It appears that there is a whole lot of display logic in the official Terraria StartInvasion method, which is why martian invasion wasn't working properly. TSAPI now contains a slighly modified startInvasion method which takes an optional invasion size, so TShock's StartInvasion method has now been refactored to use TSAPI's invasion, restoring martian invasion functionality. Fixes #1087
This commit is contained in:
parent
cd0b18ebbe
commit
4bd1b6a07a
1 changed files with 5 additions and 12 deletions
|
|
@ -1551,25 +1551,18 @@ namespace TShockAPI
|
|||
//TODO: Why is this in TShock's main class?
|
||||
public static void StartInvasion(int type)
|
||||
{
|
||||
Main.invasionType = type;
|
||||
int invasionSize = 0;
|
||||
|
||||
if (Config.InfiniteInvasion)
|
||||
{
|
||||
Main.invasionSize = 20000000;
|
||||
invasionSize = 20000000;
|
||||
}
|
||||
else
|
||||
{
|
||||
Main.invasionSize = 100 + (Config.InvasionMultiplier * Utils.ActivePlayers());
|
||||
invasionSize = 100 + (Config.InvasionMultiplier * Utils.ActivePlayers());
|
||||
}
|
||||
|
||||
Main.invasionWarn = 0;
|
||||
if (new Random().Next(2) == 0)
|
||||
{
|
||||
Main.invasionX = 0.0;
|
||||
}
|
||||
else
|
||||
{
|
||||
Main.invasionX = Main.maxTilesX;
|
||||
}
|
||||
Main.StartInvasion(type, invasionSize);
|
||||
}
|
||||
|
||||
/// <summary>CheckProjectilePermission - Checks if a projectile is banned.</summary>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue