Merge pull request 'Fix undefined luaentity crash.' (#2084) from fix-unregistered-collisions into master
Reviewed-on: https://git.minetest.land/MineClone2/MineClone2/pulls/2084 Reviewed-by: cora <cora@noreply.git.minetest.land>
This commit is contained in:
commit
bc723616ea
|
@ -222,8 +222,8 @@ local collision = function(self)
|
|||
|
||||
for _,object in pairs(minetest.get_objects_inside_radius(pos, width)) do
|
||||
|
||||
if object:is_player()
|
||||
or (object:get_luaentity()._cmi_is_mob == true and object ~= self.object) then
|
||||
local ent = object:get_luaentity()
|
||||
if object:is_player() or (ent and ent._cmi_is_mob and object ~= self.object) then
|
||||
|
||||
local pos2 = object:get_pos()
|
||||
local vec = {x = pos.x - pos2.x, z = pos.z - pos2.z}
|
||||
|
|
|
@ -35,8 +35,8 @@ local function player_collision(player)
|
|||
|
||||
for _,object in pairs(minetest.get_objects_inside_radius(pos, width)) do
|
||||
|
||||
if object and (object:is_player()
|
||||
or (object:get_luaentity()._cmi_is_mob == true and object ~= player)) then
|
||||
local ent = object:get_luaentity()
|
||||
if (object:is_player() or (ent and ent._cmi_is_mob and object ~= player)) then
|
||||
|
||||
local pos2 = object:get_pos()
|
||||
local vec = {x = pos.x - pos2.x, z = pos.z - pos2.z}
|
||||
|
|
Loading…
Reference in New Issue
Block a user