From 4151c831d6c165f5976159e8ad4a4de822ac8ad0 Mon Sep 17 00:00:00 2001 From: Simon311 Date: Mon, 7 Oct 2013 10:40:56 +0400 Subject: [PATCH 1/4] Fixing improper / handling This might be as old as TShock itself. Also, you might as well do & args.Text != "/" instead of Length, it is just a matter of taste. --- TShockAPI/TShock.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TShockAPI/TShock.cs b/TShockAPI/TShock.cs index e98168cb..39eb77b2 100755 --- a/TShockAPI/TShock.cs +++ b/TShockAPI/TShock.cs @@ -946,7 +946,7 @@ namespace TShockAPI return; }*/ - if (args.Text.StartsWith("/")) + if (args.Text.StartsWith("/") & args.Text.Length > 1) { try { From a1fa2cdb9cc6e136978951bfb1338ca6bff9c5cc Mon Sep 17 00:00:00 2001 From: Simon311 Date: Mon, 7 Oct 2013 10:44:54 +0400 Subject: [PATCH 2/4] Fixing Heart and Star requiring inventory slot Those don't ever get to inventory, they are consumed by players :) --- TShockAPI/Commands.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/TShockAPI/Commands.cs b/TShockAPI/Commands.cs index 633b1c96..bfe9cce6 100755 --- a/TShockAPI/Commands.cs +++ b/TShockAPI/Commands.cs @@ -4019,7 +4019,7 @@ namespace TShockAPI } } - if (args.Player.InventorySlotAvailable || item.name.Contains("Coin")) + if (args.Player.InventorySlotAvailable || item.name.Contains("Coin") || item.type == 58 || item.type == 184) { if (itemAmount == 0 || itemAmount > item.maxStack) itemAmount = item.maxStack; @@ -4099,7 +4099,7 @@ namespace TShockAPI else { var plr = players[0]; - if (plr.InventorySlotAvailable || item.name.Contains("Coin")) + if (plr.InventorySlotAvailable || item.name.Contains("Coin") || item.type == 58 || item.type == 184) { if (itemAmount == 0 || itemAmount > item.maxStack) itemAmount = item.maxStack; From 55537d3034aefe1c1487f6f350f4efc9d9121f52 Mon Sep 17 00:00:00 2001 From: Simon311 Date: Mon, 7 Oct 2013 10:58:56 +0400 Subject: [PATCH 3/4] Coin Gun is not eligible for this ;) --- TShockAPI/Commands.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/TShockAPI/Commands.cs b/TShockAPI/Commands.cs index bfe9cce6..f0633f0e 100755 --- a/TShockAPI/Commands.cs +++ b/TShockAPI/Commands.cs @@ -4019,7 +4019,7 @@ namespace TShockAPI } } - if (args.Player.InventorySlotAvailable || item.name.Contains("Coin") || item.type == 58 || item.type == 184) + if (args.Player.InventorySlotAvailable || (item.name.Contains("Coin") & item.type != 905) || item.type == 58 || item.type == 184) { if (itemAmount == 0 || itemAmount > item.maxStack) itemAmount = item.maxStack; @@ -4099,7 +4099,7 @@ namespace TShockAPI else { var plr = players[0]; - if (plr.InventorySlotAvailable || item.name.Contains("Coin") || item.type == 58 || item.type == 184) + if (plr.InventorySlotAvailable || (item.name.Contains("Coin") & item.type != 905) || item.type == 58 || item.type == 184) { if (itemAmount == 0 || itemAmount > item.maxStack) itemAmount = item.maxStack; From f63758a7d49d65e7786de7d3b88ef94f8e5c0424 Mon Sep 17 00:00:00 2001 From: Simon311 Date: Mon, 7 Oct 2013 11:44:53 +0400 Subject: [PATCH 4/4] & -> && --- TShockAPI/Commands.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/TShockAPI/Commands.cs b/TShockAPI/Commands.cs index f0633f0e..005fdfe4 100755 --- a/TShockAPI/Commands.cs +++ b/TShockAPI/Commands.cs @@ -4019,7 +4019,7 @@ namespace TShockAPI } } - if (args.Player.InventorySlotAvailable || (item.name.Contains("Coin") & item.type != 905) || item.type == 58 || item.type == 184) + if (args.Player.InventorySlotAvailable || (item.name.Contains("Coin") && item.type != 905) || item.type == 58 || item.type == 184) { if (itemAmount == 0 || itemAmount > item.maxStack) itemAmount = item.maxStack; @@ -4099,7 +4099,7 @@ namespace TShockAPI else { var plr = players[0]; - if (plr.InventorySlotAvailable || (item.name.Contains("Coin") & item.type != 905) || item.type == 58 || item.type == 184) + if (plr.InventorySlotAvailable || (item.name.Contains("Coin") && item.type != 905) || item.type == 58 || item.type == 184) { if (itemAmount == 0 || itemAmount > item.maxStack) itemAmount = item.maxStack;