hotbar: wrap

This commit is contained in:
2026-01-09 18:10:16 +02:00
parent 4785795640
commit bc62f8bd70
4 changed files with 81 additions and 51 deletions

View File

@@ -117,10 +117,12 @@ function ClientState:SetSelectedSlot(slot: number)
return
end
local hotbar = replicaForPlayer.Data.hotbar
if not hotbar or not hotbar[slot] then
if not hotbar then
return
end
replicaForPlayer:FireServer("SelectHotbarSlot", slot)
if slot and slot >= 1 and slot <= HOTBAR_SIZE then
replicaForPlayer:FireServer("SelectHotbarSlot", slot)
end
end
ClientState.Changed = changed.Event