Rename EnvRef:add_luaentity to EnvRef:add_entity

This commit is contained in:
Perttu Ahola 2011-12-04 16:08:37 +02:00
parent 09c48b60bd
commit ea36951bc4
2 changed files with 7 additions and 7 deletions

@ -148,7 +148,7 @@
-- ^ Returns nil for unloaded area -- ^ Returns nil for unloaded area
-- - get_node_light(pos, timeofday) -> 0...15 or nil -- - get_node_light(pos, timeofday) -> 0...15 or nil
-- ^ timeofday: nil = current time, 0 = night, 0.5 = day -- ^ timeofday: nil = current time, 0 = night, 0.5 = day
-- - add_luaentity(pos, name) -- - add_entity(pos, name)
-- - add_item(pos, itemstring) -- - add_item(pos, itemstring)
-- - add_rat(pos) -- - add_rat(pos)
-- - add_firefly(pos) -- - add_firefly(pos)
@ -1335,7 +1335,7 @@ function nodeupdate_single(p)
n_bottom = minetest.env:get_node(p_bottom) n_bottom = minetest.env:get_node(p_bottom)
if n_bottom.name == "air" then if n_bottom.name == "air" then
minetest.env:remove_node(p) minetest.env:remove_node(p)
minetest.env:add_luaentity(p, "default:falling_"..n.name) minetest.env:add_entity(p, "default:falling_"..n.name)
nodeupdate(p) nodeupdate(p)
end end
end end
@ -1491,7 +1491,7 @@ minetest.register_on_chat_message(function(name, message)
print("Unable to spawn entity, player is nil") print("Unable to spawn entity, player is nil")
return true -- Handled chat message return true -- Handled chat message
end end
minetest.env:add_luaentity(player:getpos(), entityname) minetest.env:add_entity(player:getpos(), entityname)
minetest.chat_send_player(name, '"'..entityname minetest.chat_send_player(name, '"'..entityname
..'" spawned.'); ..'" spawned.');
return true -- Handled chat message return true -- Handled chat message

@ -2430,11 +2430,11 @@ private:
} }
} }
// EnvRef:add_luaentity(pos, entityname) // EnvRef:add_entity(pos, entityname)
// pos = {x=num, y=num, z=num} // pos = {x=num, y=num, z=num}
static int l_add_luaentity(lua_State *L) static int l_add_entity(lua_State *L)
{ {
//infostream<<"EnvRef::l_add_luaentity()"<<std::endl; //infostream<<"EnvRef::l_add_entity()"<<std::endl;
EnvRef *o = checkobject(L, 1); EnvRef *o = checkobject(L, 1);
ServerEnvironment *env = o->m_env; ServerEnvironment *env = o->m_env;
if(env == NULL) return 0; if(env == NULL) return 0;
@ -2600,7 +2600,7 @@ const luaL_reg EnvRef::methods[] = {
method(EnvRef, get_node), method(EnvRef, get_node),
method(EnvRef, get_node_or_nil), method(EnvRef, get_node_or_nil),
method(EnvRef, get_node_light), method(EnvRef, get_node_light),
method(EnvRef, add_luaentity), method(EnvRef, add_entity),
method(EnvRef, add_item), method(EnvRef, add_item),
method(EnvRef, add_rat), method(EnvRef, add_rat),
method(EnvRef, add_firefly), method(EnvRef, add_firefly),