mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-06 19:41:51 +00:00
add entity:get_player()
This commit is contained in:
parent
65fec4f4a9
commit
9cd3f3e4c8
5 changed files with 33 additions and 3 deletions
|
|
@ -12,7 +12,11 @@ local function refresh_model(id)
|
|||
end
|
||||
|
||||
function on_render()
|
||||
local invid, slotid = player.get_inventory(hud.get_player())
|
||||
local pid = entity:get_player()
|
||||
if pid == -1 then
|
||||
return
|
||||
end
|
||||
local invid, slotid = player.get_inventory(pid)
|
||||
local id, _ = inventory.get(invid, slotid)
|
||||
if id ~= itemid then
|
||||
refresh_model(id)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue