Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 10 additions & 9 deletions TShockAPI/TShock.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1096,11 +1096,12 @@ private void OnUpdate(EventArgs args)
/// <summary>OnSecondUpdate - Called effectively every second for all time based checks.</summary>
private void OnSecondUpdate()
{
DisableFlags flags = Config.Settings.DisableSecondUpdateLogs ? DisableFlags.WriteToConsole : DisableFlags.WriteToLogAndConsole;
var settings = Config.Settings;
DisableFlags flags = settings.DisableSecondUpdateLogs ? DisableFlags.WriteToConsole : DisableFlags.WriteToLogAndConsole;

if (Config.Settings.ForceTime != "normal")
if (settings.ForceTime != "normal")
{
switch (Config.Settings.ForceTime)
switch (settings.ForceTime)
{
case "day":
TSPlayer.Server.SetTime(true, 27000.0);
Expand All @@ -1117,7 +1118,7 @@ private void OnSecondUpdate()
{
if (player.TilesDestroyed != null)
{
if (player.TileKillThreshold >= Config.Settings.TileKillThreshold)
if (player.TileKillThreshold >= settings.TileKillThreshold)
{
player.Disable(GetString("Reached TileKill threshold."), flags);
TSPlayer.Server.RevertTiles(player.TilesDestroyed);
Expand All @@ -1134,7 +1135,7 @@ private void OnSecondUpdate()

if (player.TilesCreated != null)
{
if (player.TilePlaceThreshold >= Config.Settings.TilePlaceThreshold)
if (player.TilePlaceThreshold >= settings.TilePlaceThreshold)
{
player.Disable(GetString("Reached TilePlace threshold"), flags);
lock (player.TilesCreated)
Expand Down Expand Up @@ -1178,7 +1179,7 @@ private void OnSecondUpdate()
}
}

if (player.TileLiquidThreshold >= Config.Settings.TileLiquidThreshold)
if (player.TileLiquidThreshold >= settings.TileLiquidThreshold)
{
player.Disable(GetString("Reached TileLiquid threshold"), flags);
}
Expand All @@ -1187,7 +1188,7 @@ private void OnSecondUpdate()
player.TileLiquidThreshold = 0;
}

if (player.ProjectileThreshold >= Config.Settings.ProjectileThreshold)
if (player.ProjectileThreshold >= settings.ProjectileThreshold)
{
player.Disable(GetString("Reached projectile threshold"), flags);
}
Expand All @@ -1196,7 +1197,7 @@ private void OnSecondUpdate()
player.ProjectileThreshold = 0;
}

if (player.PaintThreshold >= Config.Settings.TilePaintThreshold)
if (player.PaintThreshold >= settings.TilePaintThreshold)
{
player.Disable(GetString("Reached paint threshold"), flags);
}
Expand All @@ -1205,7 +1206,7 @@ private void OnSecondUpdate()
player.PaintThreshold = 0;
}

if (player.HealOtherThreshold >= TShock.Config.Settings.HealOtherThreshold)
if (player.HealOtherThreshold >= settings.HealOtherThreshold)
{
player.Disable(GetString("Reached HealOtherPlayer threshold"), flags);
}
Expand Down