mirror of
https://github.com/minetest-mods/item_drop.git
synced 2024-11-12 04:50:22 +01:00
Simplify velocity calculation
This commit is contained in:
parent
9f54694931
commit
544381bbfe
12
init.lua
12
init.lua
|
@ -83,14 +83,10 @@ if minetest.settings:get_bool("item_drop.enable_item_pickup") ~= false then
|
||||||
ent.itemstring = ""
|
ent.itemstring = ""
|
||||||
object:remove()
|
object:remove()
|
||||||
else
|
else
|
||||||
local pos1 = pos
|
local vel = vector.multiply(
|
||||||
pos1.y = pos1.y+0.2
|
vector.subtract(pos, pos2), 3)
|
||||||
local vec = {x=pos1.x-pos2.x, y=pos1.y-pos2.y,
|
vel.y = vel.y + 0.6
|
||||||
z=pos1.z-pos2.z}
|
object:setvelocity(vel)
|
||||||
vec.x = vec.x*3
|
|
||||||
vec.y = vec.y*3
|
|
||||||
vec.z = vec.z*3
|
|
||||||
object:setvelocity(vec)
|
|
||||||
ent.physical_state = false
|
ent.physical_state = false
|
||||||
ent.object:set_properties({
|
ent.object:set_properties({
|
||||||
physical = false
|
physical = false
|
||||||
|
|
Loading…
Reference in New Issue
Block a user