From e19fd22fe0a5600af0c47c07eade94aff119f343 Mon Sep 17 00:00:00 2001 From: Lucas Nicodemus Date: Mon, 11 Dec 2017 08:18:23 -0700 Subject: [PATCH] Change Utils.SearchProjectile to return -1 in error Thanks for checking this out, @bartico6. Fixes #1549. Note: this method only returns 1 because the game won't allocate more identity/index combo. Apparently, according to RL. --- TShockAPI/Utils.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/TShockAPI/Utils.cs b/TShockAPI/Utils.cs index 0ad2d0ad..3451f5f1 100644 --- a/TShockAPI/Utils.cs +++ b/TShockAPI/Utils.cs @@ -943,7 +943,7 @@ namespace TShockAPI /// /// identity /// owner - /// projectile ID + /// projectile ID or -1 if not found public int SearchProjectile(short identity, int owner) { for (int i = 0; i < Main.maxProjectiles; i++) @@ -951,7 +951,7 @@ namespace TShockAPI if (Main.projectile[i].identity == identity && Main.projectile[i].owner == owner) return i; } - return 1000; + return -1; } ///