Fixed and enabled /annoy

This commit is contained in:
Deathmax 2011-07-08 21:27:44 +08:00
parent cf7fd6da23
commit d8d19f88e5
2 changed files with 5 additions and 6 deletions

View file

@ -167,7 +167,7 @@ namespace TShockAPI
ChatCommands.Add(new Command("cfg", Broadcast, "broadcast", "bc")); ChatCommands.Add(new Command("cfg", Broadcast, "broadcast", "bc"));
ChatCommands.Add(new Command("whisper", Whisper, "whisper", "w", "tell")); ChatCommands.Add(new Command("whisper", Whisper, "whisper", "w", "tell"));
ChatCommands.Add(new Command("whisper", Reply, "reply", "r")); ChatCommands.Add(new Command("whisper", Reply, "reply", "r"));
//ChatCommands.Add(new Command("annoy", Annoy, "annoy")); ChatCommands.Add(new Command("annoy", Annoy, "annoy"));
if (TShock.Config.DistributationAgent != "terraria-online") if (TShock.Config.DistributationAgent != "terraria-online")
{ {
ChatCommands.Add(new Command("kill", Kill, "kill")); ChatCommands.Add(new Command("kill", Kill, "kill"));

View file

@ -234,8 +234,6 @@ namespace TShockAPI
public virtual bool SendTileSquare(int x, int y, int size = 10) public virtual bool SendTileSquare(int x, int y, int size = 10)
{ {
if (x + size >= Main.maxTilesX || y + size >= Main.maxTilesX)
return false;
try try
{ {
SendData(PacketTypes.TileSendSquare, "", size, (float)(x - (size / 2)), (float)(y - (size / 2))); SendData(PacketTypes.TileSendSquare, "", size, (float)(x - (size / 2)), (float)(y - (size / 2)));
@ -306,15 +304,16 @@ namespace TShockAPI
while ((DateTime.UtcNow - launch).TotalSeconds < time2) while ((DateTime.UtcNow - launch).TotalSeconds < time2)
{ {
Main.player[0].inventory[player].SetDefaults("Whoopie Cushion"); Main.player[0].inventory[player].SetDefaults("Whoopie Cushion");
Main.player[0].inventory[player].stack = 1;
SendData(TerrariaAPI.PacketTypes.PlayerSlot, "Whoopie Cushion", player, 0f); SendData(TerrariaAPI.PacketTypes.PlayerSlot, "Whoopie Cushion", player, 0f);
Main.player[player].position = TPlayer.position; Main.player[player].position = TPlayer.position;
Main.player[player].selectedItem = 0; Main.player[player].selectedItem = 0;
Main.player[player].controlUseItem = true; Main.player[player].controlUseItem = true;
SendData(TerrariaAPI.PacketTypes.PlayerUpdate, number: player); SendData(TerrariaAPI.PacketTypes.PlayerUpdate, number: player);
Main.player[player].controlUseItem = false;
Main.player[player].controlJump = true;
SendData(TerrariaAPI.PacketTypes.PlayerUpdate, number: player);
System.Threading.Thread.Sleep(500); System.Threading.Thread.Sleep(500);
Main.player[player].controlUseItem = false;
SendData(TerrariaAPI.PacketTypes.PlayerUpdate, number: player);
System.Threading.Thread.Sleep(50);
} }
Main.player[0].inventory[0] = oriinv; Main.player[0].inventory[0] = oriinv;
SendData(TerrariaAPI.PacketTypes.PlayerSlot, oriinv.name, player, 0f); SendData(TerrariaAPI.PacketTypes.PlayerSlot, oriinv.name, player, 0f);