hotbar: wrap
This commit is contained in:
@@ -81,9 +81,6 @@ local function sanitizeSelection(hotbar, selectedSlot)
|
||||
if selectedSlot < 1 or selectedSlot > HOTBAR_SIZE then
|
||||
return (#hotbar > 0) and 1 or 0
|
||||
end
|
||||
if not hotbar[selectedSlot] then
|
||||
return (#hotbar > 0) and 1 or 0
|
||||
end
|
||||
return selectedSlot
|
||||
end
|
||||
|
||||
@@ -138,7 +135,7 @@ local function handleReplicaEvents(player: Player, replica)
|
||||
if not hotbar then
|
||||
return
|
||||
end
|
||||
if slot and slot >= 1 and slot <= HOTBAR_SIZE and hotbar[slot] then
|
||||
if slot and slot >= 1 and slot <= HOTBAR_SIZE then
|
||||
replica:Set({"selectedSlot"}, slot)
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user