Simplify velocity calculation

This commit is contained in:
Hybrid Dog 2017-09-07 20:44:08 +02:00
parent 9f54694931
commit 544381bbfe

View File

@ -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