Merge pull request #1585 from Pryaxis/fix-projectiles
Fix #1584 / Revert "Change Utils.SearchProjectile to return -1 in error"
This commit is contained in:
commit
830b1634f2
2 changed files with 3 additions and 3 deletions
|
|
@ -979,7 +979,7 @@ namespace TShockAPI
|
|||
short type = args.Type;
|
||||
int index = args.Index;
|
||||
|
||||
if (index > Main.maxProjectiles || index < 0)
|
||||
if (index > Main.maxProjectiles)
|
||||
{
|
||||
args.Player.RemoveProjectile(ident, owner);
|
||||
args.Handled = true;
|
||||
|
|
|
|||
|
|
@ -925,7 +925,7 @@ namespace TShockAPI
|
|||
/// </summary>
|
||||
/// <param name="identity">identity</param>
|
||||
/// <param name="owner">owner</param>
|
||||
/// <returns>projectile ID or -1 if not found</returns>
|
||||
/// <returns>projectile ID</returns>
|
||||
public int SearchProjectile(short identity, int owner)
|
||||
{
|
||||
for (int i = 0; i < Main.maxProjectiles; i++)
|
||||
|
|
@ -933,7 +933,7 @@ namespace TShockAPI
|
|||
if (Main.projectile[i].identity == identity && Main.projectile[i].owner == owner)
|
||||
return i;
|
||||
}
|
||||
return -1;
|
||||
return 1000;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue