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;
|
short type = args.Type;
|
||||||
int index = args.Index;
|
int index = args.Index;
|
||||||
|
|
||||||
if (index > Main.maxProjectiles || index < 0)
|
if (index > Main.maxProjectiles)
|
||||||
{
|
{
|
||||||
args.Player.RemoveProjectile(ident, owner);
|
args.Player.RemoveProjectile(ident, owner);
|
||||||
args.Handled = true;
|
args.Handled = true;
|
||||||
|
|
|
||||||
|
|
@ -925,7 +925,7 @@ namespace TShockAPI
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="identity">identity</param>
|
/// <param name="identity">identity</param>
|
||||||
/// <param name="owner">owner</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)
|
public int SearchProjectile(short identity, int owner)
|
||||||
{
|
{
|
||||||
for (int i = 0; i < Main.maxProjectiles; i++)
|
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)
|
if (Main.projectile[i].identity == identity && Main.projectile[i].owner == owner)
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
return -1;
|
return 1000;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue