修复了玩家物品栏装有物品时解析出错的问题
This commit is contained in:
@ -194,16 +194,19 @@ func handleSetSlotPacket(c *Client, p pk.Packet) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
switch int8(windowID) {
|
switch int8(windowID) {
|
||||||
case 0: //if window ID is 0, it will only change the hotbar
|
case -1:
|
||||||
if slotI < 36 || slotI > 45 {
|
// set cursor slot
|
||||||
return fmt.Errorf("slot %d out of range for window %d", slotI, windowID)
|
|
||||||
|
case 0:
|
||||||
|
if slotI >= 36 && slotI < 45 {
|
||||||
|
// Update Cooldown
|
||||||
}
|
}
|
||||||
fallthrough
|
fallthrough
|
||||||
case -2: //or if it's -2, server can change any slot without animation
|
case -2:
|
||||||
if slotI < 0 || slotI > 45 {
|
// set inventory
|
||||||
return fmt.Errorf("slot %d out of range for window %d", slotI, windowID)
|
|
||||||
}
|
|
||||||
c.Inventory[slotI] = slot
|
c.Inventory[slotI] = slot
|
||||||
|
default:
|
||||||
|
//other window
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user