Move the projectile refresh to Bouncer.
Bouncer now has an OnSecondUpdate(). Move projectile created tracking to GetDataHandler from Bouncer.
This commit is contained in:
parent
9209ac0b73
commit
b73088306d
3 changed files with 33 additions and 27 deletions
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue