From 3db37bb94a592346d99f9d86fceb8b05fed1e812 Mon Sep 17 00:00:00 2001 From: MarioE Date: Tue, 8 Oct 2013 19:45:04 -0400 Subject: [PATCH] Item stacks are shorts. Fixes severe SSC bugs --- TShockAPI/GetDataHandlers.cs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/TShockAPI/GetDataHandlers.cs b/TShockAPI/GetDataHandlers.cs index 57526c57..24451041 100644 --- a/TShockAPI/GetDataHandlers.cs +++ b/TShockAPI/GetDataHandlers.cs @@ -198,7 +198,7 @@ namespace TShockAPI /// /// The stack edited /// - public byte Stack { get; set; } + public short Stack { get; set; } /// /// The item prefix /// @@ -212,7 +212,7 @@ namespace TShockAPI /// PlayerSlot - called at a PlayerSlot event /// public static HandlerList PlayerSlot; - private static bool OnPlayerSlot(byte _plr, byte _slot, byte _stack, byte _prefix, short _type) + private static bool OnPlayerSlot(byte _plr, byte _slot, short _stack, byte _prefix, short _type) { if (PlayerSlot == null) return false; @@ -751,7 +751,7 @@ namespace TShockAPI /// /// How many? /// - public byte Stacks { get; set; } + public short Stacks { get; set; } /// /// Item prefix /// @@ -766,7 +766,7 @@ namespace TShockAPI /// public static HandlerList ChestItemChange; - private static bool OnChestItemChange(short id, byte slot, byte stacks, byte prefix, short type) + private static bool OnChestItemChange(short id, byte slot, short stacks, byte prefix, short type) { if (ChestItemChange == null) return false; @@ -922,7 +922,7 @@ namespace TShockAPI /// /// Stacks /// - public Int16 Stacks { get; set; } + public short Stacks { get; set; } /// /// Prefix of the item /// @@ -941,7 +941,7 @@ namespace TShockAPI /// public static HandlerList ItemDrop; - private static bool OnItemDrop(short id, Vector2 pos, Vector2 vel, Int16 stacks, byte prefix, bool noDelay, short type) + private static bool OnItemDrop(short id, Vector2 pos, Vector2 vel, short stacks, byte prefix, bool noDelay, short type) { if (ItemDrop == null) return false; @@ -1258,7 +1258,7 @@ namespace TShockAPI { byte plr = args.Data.ReadInt8(); byte slot = args.Data.ReadInt8(); - byte stack = args.Data.ReadInt8(); + short stack = args.Data.ReadInt16(); byte prefix = args.Data.ReadInt8(); short type = args.Data.ReadInt16(); @@ -2746,7 +2746,7 @@ namespace TShockAPI { var id = args.Data.ReadInt16(); var slot = args.Data.ReadInt8(); - var stacks = args.Data.ReadInt8(); + var stacks = args.Data.ReadInt16(); var prefix = args.Data.ReadInt8(); var type = args.Data.ReadInt16();