Add a projectile tracker, so that we can allow fluid bombs.
This commit is contained in:
parent
ae87f242d7
commit
965361c406
4 changed files with 68 additions and 7 deletions
|
|
@ -44,6 +44,7 @@ using Microsoft.Xna.Framework;
|
|||
using TShockAPI.Sockets;
|
||||
using TShockAPI.CLI;
|
||||
using TShockAPI.Localization;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace TShockAPI
|
||||
{
|
||||
|
|
@ -1064,6 +1065,18 @@ 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();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
Utils.SetConsoleTitle(false);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue