feat: support items data in base pack

This commit is contained in:
MihailRis
2025-02-18 01:03:34 +03:00
parent 5384843892
commit 3aa7d6ac28
6 changed files with 21 additions and 8 deletions
+2 -1
View File
@@ -14,12 +14,13 @@ function on_hud_open()
if itemid == 0 then
return
end
local data = inventory.get_all_data(invid, slot)
inventory.set(invid, slot, itemid, itemcount-1)
local pvel = {player.get_vel(pid)}
local ppos = vec3.add({player.get_pos(pid)}, {0, 0.7, 0})
local throw_force = vec3.mul(player.get_dir(pid), DROP_FORCE)
local drop = base_util.drop(ppos, itemid, 1, 1.5)
local drop = base_util.drop(ppos, itemid, 1, data, 1.5)
local velocity = vec3.add(throw_force, vec3.add(pvel, DROP_INIT_VEL))
drop.rigidbody:set_vel(velocity)
end)