From 70bbdb4fa2729cd1384c64d53ee4d16aa5520a84 Mon Sep 17 00:00:00 2001 From: stujones11 Date: Sun, 25 Jan 2015 18:42:09 +0000 Subject: [PATCH] Fix compatibility with other mob mods --- shooter.lua | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/shooter.lua b/shooter.lua index d3c3c44..463c64b 100644 --- a/shooter.lua +++ b/shooter.lua @@ -46,11 +46,6 @@ if singleplayer then SHOOTER_ALLOW_PLAYERS = false end -local allowed_entities = {} -for _,v in ipairs(SHOOTER_ENTITIES) do - allowed_entities[v] = 1 -end - local modpath = minetest.get_modpath(minetest.get_current_modname()) local input = io.open(modpath.."/shooter.conf", "r") if input then @@ -59,6 +54,11 @@ if input then input = nil end +local allowed_entities = {} +for _,v in ipairs(SHOOTER_ENTITIES) do + allowed_entities[v] = 1 +end + local function get_dot_product(v1, v2) return v1.x * v2.x + v1.y * v2.y + v1.z * v2.z end @@ -319,7 +319,7 @@ function shooter:load_objects() name = ref.name, object = ref.object, pos = pos, - collisionbox = def.collisionbox, + collisionbox = def.collisionbox or {0,0,0, 0,0,0}, offset = SHOOTER_ENTITY_OFFSET, }) end