sfan5 wrote:Hackeridze wrote:Bad realization.
It's 75% the best possible realization
local objs = minetest.env:get_objects_inside_radius({x=playerpos.x,y=playerpos.y,z=playerpos.z}, 2)
Hackeridze wrote:sfan5 wrote:Hackeridze wrote:Bad realization.
It's 75% the best possible realization
Are you idiot?
minetest.env:add_entity() should return objref to added entity. Just simple patch.
sfan5 wrote:Hackeridze wrote:sfan5 wrote:It's 75% the best possible realization
Are you idiot?
No
Are you idiot?
So you just mistaken in suggestion about code-quality?
Who I call an idiot?
Are you idiot?
Okay, we need a patch:
minetest.env:add_entity() should return objref to added entity.
sapier wrote:Are you idiot?
I appologize if I did translate it wrong but in my country asking this question is almost exactly the same as calling.
sapier wrote:If you don't like the mod, Hackeridze, just ignore it!
sapier wrote:It was, as sfan said, the 75% best possible solution without changing the minetest c++ source.
sfan5 wrote:It's 75% the best possible realization
sapier wrote:RTMMMP's things can be added when creating a mod-pack.
Tsumiman wrote:And how does code-quality associated with calling sombody an idiot?
Because we can forgive idiot's mistakes.
sapier wrote:Because we can forgive idiot's mistakes.
<ironic> Yes, I think we can do that</ironic>
It's 75% the best possible realization
But this discussion is a little bit off-topic
// EnvRef:add_entity(pos, entityname)
// pos = {x=num, y=num, z=num}
static int l_add_entity(lua_State *L)
{
//infostream<<"EnvRef::l_add_entity()"<<std::endl;
EnvRef *o = checkobject(L, 1);
ServerEnvironment *env = o->m_env;
if(env == NULL) return 0;
// pos
v3f pos = readFloatPos(L, 2);
// content
const char *name = luaL_checkstring(L, 3);
// Do it
ServerActiveObject *obj = new LuaEntitySAO(env, pos, name, "");
env->addActiveObject(obj);
// Return created entity
objectref_get_or_create(L, obj);
return 1;
}
Users browsing this forum: No registered users and 13 guests