Move ComputeMaxStyles to Utils
This commit is contained in:
parent
e85d79e23d
commit
fc233bd3f1
2 changed files with 21 additions and 21 deletions
|
|
@ -875,7 +875,7 @@ namespace TShockAPI
|
||||||
Regions.Reload();
|
Regions.Reload();
|
||||||
Warps.ReloadWarps();
|
Warps.ReloadWarps();
|
||||||
|
|
||||||
ComputeMaxStyles();
|
Utils.ComputeMaxStyles();
|
||||||
Utils.FixChestStacks();
|
Utils.FixChestStacks();
|
||||||
|
|
||||||
Utils.UpgradeMotD();
|
Utils.UpgradeMotD();
|
||||||
|
|
@ -889,26 +889,6 @@ namespace TShockAPI
|
||||||
StatTracker.Start();
|
StatTracker.Start();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>ComputeMaxStyles - Computes the max styles...</summary>
|
|
||||||
private void ComputeMaxStyles()
|
|
||||||
{
|
|
||||||
var item = new Item();
|
|
||||||
for (int i = 0; i < Main.maxItemTypes; i++)
|
|
||||||
{
|
|
||||||
item.netDefaults(i);
|
|
||||||
if (item.placeStyle > 0)
|
|
||||||
{
|
|
||||||
if (GetDataHandlers.MaxPlaceStyles.ContainsKey(item.createTile))
|
|
||||||
{
|
|
||||||
if (item.placeStyle > GetDataHandlers.MaxPlaceStyles[item.createTile])
|
|
||||||
GetDataHandlers.MaxPlaceStyles[item.createTile] = item.placeStyle;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
GetDataHandlers.MaxPlaceStyles.Add(item.createTile, item.placeStyle);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>LastCheck - Used to keep track of the last check for basically all time based checks.</summary>
|
/// <summary>LastCheck - Used to keep track of the last check for basically all time based checks.</summary>
|
||||||
private DateTime LastCheck = DateTime.UtcNow;
|
private DateTime LastCheck = DateTime.UtcNow;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1468,5 +1468,25 @@ namespace TShockAPI
|
||||||
float num3 = (num2 * num2) + (num * num);
|
float num3 = (num2 * num2) + (num * num);
|
||||||
return (float)Math.Sqrt(num3);
|
return (float)Math.Sqrt(num3);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>ComputeMaxStyles - Computes the max styles...</summary>
|
||||||
|
internal void ComputeMaxStyles()
|
||||||
|
{
|
||||||
|
var item = new Item();
|
||||||
|
for (int i = 0; i < Main.maxItemTypes; i++)
|
||||||
|
{
|
||||||
|
item.netDefaults(i);
|
||||||
|
if (item.placeStyle > 0)
|
||||||
|
{
|
||||||
|
if (GetDataHandlers.MaxPlaceStyles.ContainsKey(item.createTile))
|
||||||
|
{
|
||||||
|
if (item.placeStyle > GetDataHandlers.MaxPlaceStyles[item.createTile])
|
||||||
|
GetDataHandlers.MaxPlaceStyles[item.createTile] = item.placeStyle;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
GetDataHandlers.MaxPlaceStyles.Add(item.createTile, item.placeStyle);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue