Add KillProjectile command
This commit is contained in:
parent
7e5909e04c
commit
90231a73a4
1 changed files with 29 additions and 0 deletions
|
|
@ -238,6 +238,7 @@ namespace TShockAPI
|
||||||
add(Permissions.butcher, Butcher, "butcher");
|
add(Permissions.butcher, Butcher, "butcher");
|
||||||
add(Permissions.item, Give, "give", "g");
|
add(Permissions.item, Give, "give", "g");
|
||||||
add(Permissions.clearitems, ClearItems, "clear", "clearitems");
|
add(Permissions.clearitems, ClearItems, "clear", "clearitems");
|
||||||
|
add(Permissions.clearitems, KillProjectiles, "killprojectile");
|
||||||
add(Permissions.heal, Heal, "heal");
|
add(Permissions.heal, Heal, "heal");
|
||||||
add(Permissions.buffplayer, GBuff, "gbuff", "buffplayer");
|
add(Permissions.buffplayer, GBuff, "gbuff", "buffplayer");
|
||||||
add(Permissions.hardmode, StartHardMode, "hardmode");
|
add(Permissions.hardmode, StartHardMode, "hardmode");
|
||||||
|
|
@ -3641,6 +3642,34 @@ namespace TShockAPI
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static void KillProjectiles(CommandArgs args)
|
||||||
|
{
|
||||||
|
if (args.Parameters.Count == 0)
|
||||||
|
{
|
||||||
|
foreach (Projectile p in Main.projectile)
|
||||||
|
{
|
||||||
|
if (p != null && p.active)
|
||||||
|
{
|
||||||
|
p.Kill();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
int id;
|
||||||
|
if (int.TryParse(args.Parameters[0], out id))
|
||||||
|
{
|
||||||
|
foreach (Projectile p in Main.projectile)
|
||||||
|
{
|
||||||
|
if (p != null && p.active && p.type == id)
|
||||||
|
{
|
||||||
|
p.Kill();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private static void Aliases(CommandArgs args)
|
private static void Aliases(CommandArgs args)
|
||||||
{
|
{
|
||||||
if (args.Parameters.Count < 1)
|
if (args.Parameters.Count < 1)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue