autodetect ":" to beginning of entity registration and auto added if not present
* improves the commit commit b1ad4451a7 that really helps to registered external mobs but this could break others already implemented.. i mean.. what happened if someone already add the ":" prefix? This commit addressed that! * this close https://notabug.org/TenPlus1/mobs_redo/issues/154 fixed in good way
This commit is contained in:
parent
a89c912829
commit
a4cf246fce
8
api.lua
8
api.lua
@ -3665,10 +3665,10 @@ function mobs:register_mob(name, def)
|
||||
collisionbox[5] = collisionbox[2] + 0.99
|
||||
end
|
||||
|
||||
minetest.register_entity(":" .. name, setmetatable({
|
||||
minetest.register_entity(name, setmetatable({
|
||||
|
||||
stepheight = def.stepheight,
|
||||
name = name,
|
||||
name = (name:find(":") and name or ":"..name),
|
||||
type = def.type,
|
||||
attack_type = def.attack_type,
|
||||
fly = def.fly,
|
||||
@ -4238,7 +4238,7 @@ function mobs:register_arrow(name, def)
|
||||
|
||||
if not name or not def then return end -- errorcheck
|
||||
|
||||
minetest.register_entity(":" .. name, {
|
||||
minetest.register_entity( (name:find(":") and name or ":"..name) , {
|
||||
|
||||
physical = def.physical or false,
|
||||
collide_with_objects = def.collide_with_objects or false,
|
||||
@ -4910,7 +4910,7 @@ function mobs:alias_mob(old_name, new_name)
|
||||
minetest.register_alias(old_name, new_name)
|
||||
|
||||
-- entity
|
||||
minetest.register_entity(":" .. old_name, {
|
||||
minetest.register_entity( (old_name:find(":") and old_name or ":"..old_name) , {
|
||||
|
||||
physical = false, static_save = false,
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user