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.
This commit is contained in:
parent
6ed110f862
commit
e19fd22fe0
1 changed files with 2 additions and 2 deletions
|
|
@ -943,7 +943,7 @@ namespace TShockAPI
|
|||
/// </summary>
|
||||
/// <param name="identity">identity</param>
|
||||
/// <param name="owner">owner</param>
|
||||
/// <returns>projectile ID</returns>
|
||||
/// <returns>projectile ID or -1 if not found</returns>
|
||||
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;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue