mirror of
https://github.com/minetest-mods/mesecons.git
synced 2025-01-27 08:40:16 +01:00
MVPS: don't move non-physical objects
This commit is contained in:
parent
54de66b3e1
commit
212979932f
@ -274,10 +274,12 @@ function mesecon.mvps_move_objects(pos, dir, nodestack, movefactor)
|
|||||||
dir = vector.multiply(dir, movefactor)
|
dir = vector.multiply(dir, movefactor)
|
||||||
for id, obj in pairs(minetest.get_objects_inside_radius(pos, #nodestack + 1)) do
|
for id, obj in pairs(minetest.get_objects_inside_radius(pos, #nodestack + 1)) do
|
||||||
local obj_pos = obj:get_pos()
|
local obj_pos = obj:get_pos()
|
||||||
local cbox = obj:get_properties().collisionbox
|
local props = obj:get_properties()
|
||||||
|
local ok = true
|
||||||
|
if props.physical then
|
||||||
|
local cbox = props.collisionbox
|
||||||
local min_pos = vector.add(obj_pos, vector.new(cbox[1], cbox[2], cbox[3]))
|
local min_pos = vector.add(obj_pos, vector.new(cbox[1], cbox[2], cbox[3]))
|
||||||
local max_pos = vector.add(obj_pos, vector.new(cbox[4], cbox[5], cbox[6]))
|
local max_pos = vector.add(obj_pos, vector.new(cbox[4], cbox[5], cbox[6]))
|
||||||
local ok = true
|
|
||||||
for k, v in pairs(pos) do
|
for k, v in pairs(pos) do
|
||||||
local edge1, edge2
|
local edge1, edge2
|
||||||
if k ~= dir_k then
|
if k ~= dir_k then
|
||||||
@ -296,6 +298,9 @@ function mesecon.mvps_move_objects(pos, dir, nodestack, movefactor)
|
|||||||
break
|
break
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
else
|
||||||
|
ok = false -- not physical
|
||||||
|
end
|
||||||
if ok then
|
if ok then
|
||||||
local ent = obj:get_luaentity()
|
local ent = obj:get_luaentity()
|
||||||
if obj:is_player() or (ent and not mesecon.is_mvps_unmov(ent.name)) then
|
if obj:is_player() or (ent and not mesecon.is_mvps_unmov(ent.name)) then
|
||||||
|
Loading…
Reference in New Issue
Block a user