diff --git a/TShockAPI/GetDataHandlers.cs b/TShockAPI/GetDataHandlers.cs index b495f0f9..807a1b75 100644 --- a/TShockAPI/GetDataHandlers.cs +++ b/TShockAPI/GetDataHandlers.cs @@ -1514,15 +1514,15 @@ namespace TShockAPI var dmg = args.Data.ReadInt16(); var owner = args.Data.ReadInt8(); var type = args.Data.ReadInt8(); - - var index = TShock.Utils.SearchProjectile(ident); + owner = (byte)args.Player.Index; + var index = TShock.Utils.SearchProjectile(ident, owner); if (OnNewProjectile(ident, pos, vel, knockback, dmg, owner, type, index)) return true; if (index > Main.maxProjectiles || index < 0) { - return true; + return false; } if (args.Player.Index != owner) @@ -1577,22 +1577,23 @@ namespace TShockAPI { var ident = args.Data.ReadInt16(); var owner = args.Data.ReadInt8(); - - var index = TShock.Utils.SearchProjectile(ident); + owner = (byte)args.Player.Index; + var index = TShock.Utils.SearchProjectile(ident, owner); if (index > Main.maxProjectiles || index < 0) { - return true; + return false; } var type = Main.projectile[index].type; - if (args.Player.Index != Main.projectile[index].owner && type != 102 && type != 100 && !TShock.Config.IgnoreProjKill) // workaround for skeletron prime projectiles + // Players can no longer destroy projectiles that are not theirs as of 1.1.2 + /*if (args.Player.Index != Main.projectile[index].owner && type != 102 && type != 100 && !TShock.Config.IgnoreProjKill) // workaround for skeletron prime projectiles { args.Player.Disable("Owner and player ID does not match to kill projectile"); args.Player.RemoveProjectile(ident, owner); return true; - } + }*/ if (TShock.CheckIgnores(args.Player)) { diff --git a/TShockAPI/TShock.cs b/TShockAPI/TShock.cs index 4f782588..f135033a 100644 --- a/TShockAPI/TShock.cs +++ b/TShockAPI/TShock.cs @@ -1068,7 +1068,7 @@ namespace TShockAPI return true; } - if (proj.hostile) + if (Main.projHostile[type]) { //player.SendMessage( proj.name, Color.Yellow); return true; diff --git a/TShockAPI/Utils.cs b/TShockAPI/Utils.cs index bd3b201a..79a80562 100644 --- a/TShockAPI/Utils.cs +++ b/TShockAPI/Utils.cs @@ -705,14 +705,14 @@ namespace TShockAPI return true; } - public int SearchProjectile(short identity) + public int SearchProjectile(short identity, int owner) { for (int i = 0; i < Main.maxProjectiles; i++) { - if (Main.projectile[i].identity == identity) + if (Main.projectile[i].identity == identity && Main.projectile[i].owner == owner) return i; } - return 1001; + return 1000; } public string SanitizeString(string str)