Fix potential crash, Fix namespace issue, Fix crash when using fancy step

This commit is contained in:
ElCeejo 2022-04-09 12:47:32 -07:00
parent 02322ca861
commit fc19778172
2 changed files with 11 additions and 43 deletions

View file

@ -873,6 +873,8 @@ end
-- Physics
local moveable = creatura.is_pos_moveable
local function do_step(self)
if not fancy_step then return end
local pos = self.object:get_pos()
@ -916,8 +918,8 @@ local function collision_detection(self)
for i = 2, #objects do
local object = objects[i]
if creatura.is_alive(object)
and (not object:get_attach()
or object:get_attach() ~= self.object) then
and not self.object:get_attach()
and not object:get_attach() then
if i > 5 then break end
local pos2 = object:get_pos()
local dir = vec_dir(pos, pos2)