From 9b2360fc932cd6da56040e1db06180235dcb5206 Mon Sep 17 00:00:00 2001 From: Tnze Date: Sat, 15 Jun 2019 15:52:25 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=BA=86=E7=8E=A9=E5=AE=B6?= =?UTF-8?q?=E7=89=A9=E5=93=81=E6=A0=8F=E8=A3=85=E6=9C=89=E7=89=A9=E5=93=81?= =?UTF-8?q?=E6=97=B6=E8=A7=A3=E6=9E=90=E5=87=BA=E9=94=99=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bot/ingame.go | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/bot/ingame.go b/bot/ingame.go index 904ad4d..6606698 100644 --- a/bot/ingame.go +++ b/bot/ingame.go @@ -194,16 +194,19 @@ func handleSetSlotPacket(c *Client, p pk.Packet) error { } switch int8(windowID) { - case 0: //if window ID is 0, it will only change the hotbar - if slotI < 36 || slotI > 45 { - return fmt.Errorf("slot %d out of range for window %d", slotI, windowID) + case -1: + // set cursor slot + + case 0: + if slotI >= 36 && slotI < 45 { + // Update Cooldown } fallthrough - case -2: //or if it's -2, server can change any slot without animation - if slotI < 0 || slotI > 45 { - return fmt.Errorf("slot %d out of range for window %d", slotI, windowID) - } + case -2: + // set inventory c.Inventory[slotI] = slot + default: + //other window } return nil }