From 85a46562748c802a1be4ec9c769c3e9f0c38afa8 Mon Sep 17 00:00:00 2001 From: AkjaHAsLk1IALk0MasH <46046453+AgaSpace@users.noreply.github.com> Date: Fri, 26 Nov 2021 23:52:05 +0700 Subject: [PATCH] Added values for AI[]. --- TShockAPI/GetDataHandlers.cs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/TShockAPI/GetDataHandlers.cs b/TShockAPI/GetDataHandlers.cs index 02ff7de4..c4366961 100644 --- a/TShockAPI/GetDataHandlers.cs +++ b/TShockAPI/GetDataHandlers.cs @@ -689,12 +689,17 @@ namespace TShockAPI /// ??? /// public int Index { get; set; } + + /// + /// The special meaning of the projectile. + /// + public float[] Ai { get; set; } } /// /// NewProjectile - Called when a client creates a new projectile /// public static HandlerList NewProjectile = new HandlerList(); - private static bool OnNewProjectile(MemoryStream data, short ident, Vector2 pos, Vector2 vel, float knockback, short dmg, byte owner, short type, int index, TSPlayer player) + private static bool OnNewProjectile(MemoryStream data, short ident, Vector2 pos, Vector2 vel, float knockback, short dmg, byte owner, short type, int index, TSPlayer player, float[] ai) { if (NewProjectile == null) return false; @@ -711,6 +716,7 @@ namespace TShockAPI Type = type, Index = index, Player = player, + Ai = ai }; NewProjectile.Invoke(null, args); return args.Handled; @@ -2788,7 +2794,7 @@ namespace TShockAPI var index = TShock.Utils.SearchProjectile(ident, owner); - if (OnNewProjectile(args.Data, ident, pos, vel, knockback, dmg, owner, type, index, args.Player)) + if (OnNewProjectile(args.Data, ident, pos, vel, knockback, dmg, owner, type, index, args.Player, ai)) return true; lock (args.Player.RecentlyCreatedProjectiles)