Move the projectile refresh to Bouncer.

Bouncer now has an OnSecondUpdate().
Move projectile created tracking to GetDataHandler from Bouncer.
This commit is contained in:
Olink 2020-05-24 04:27:12 -04:00
parent 9209ac0b73
commit b73088306d
3 changed files with 33 additions and 27 deletions

View file

@ -44,7 +44,6 @@ using Microsoft.Xna.Framework;
using TShockAPI.Sockets;
using TShockAPI.CLI;
using TShockAPI.Localization;
using System.Threading.Tasks;
namespace TShockAPI
{
@ -1065,19 +1064,9 @@ namespace TShockAPI
}
}
}
Task.Run(() =>
{
if (player != null && player.TPlayer.whoAmI >= 0)
{
var threshold = DateTime.Now.AddSeconds(-5);
lock (player.RecentlyCreatedProjectiles)
{
player.RecentlyCreatedProjectiles = player.RecentlyCreatedProjectiles.Where(s => s.CreatedAt > threshold).ToList();
}
}
});
}
Bouncer.OnSecondUpdate();
Utils.SetConsoleTitle(false);
}