From 22b51cea146dc02c01f99f4e162dbb2513409e8d Mon Sep 17 00:00:00 2001 From: stujones11 Date: Fri, 11 Sep 2015 19:07:51 +0100 Subject: [PATCH] Add auto configuration for all simple mobs derivatives --- depends.txt | 2 +- shooter.lua | 16 ++++++---------- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/depends.txt b/depends.txt index 2de5ab8..d2aa8ff 100644 --- a/depends.txt +++ b/depends.txt @@ -2,4 +2,4 @@ default dye tnt wool - +mobs? diff --git a/shooter.lua b/shooter.lua index 48fb583..6e9ae3d 100644 --- a/shooter.lua +++ b/shooter.lua @@ -28,16 +28,12 @@ SHOOTER_OBJECT_UPDATE_TIME = 0.25 SHOOTER_ROUNDS_UPDATE_TIME = 0.4 SHOOTER_PLAYER_OFFSET = {x=0, y=1, z=0} SHOOTER_ENTITY_OFFSET = {x=0, y=0, z=0} -SHOOTER_ENTITIES = { - "mobs:dirt_monster", - "mobs:stone_monster", - "mobs:sand_monster", - "mobs:tree_monster", - "mobs:sheep", - "mobs:rat", - "mobs:oerkki", - "mobs:dungeon_master", -} +SHOOTER_ENTITIES = {} +for k, v in pairs(minetest.registered_entities) do + if string.find(k, "^mobs") then + table.insert(SHOOTER_ENTITIES, k) + end +end local singleplayer = minetest.is_singleplayer() if singleplayer then