Posted: Sun Jan 01, 2012 21:55
You're right Tsumiman! Thanks for reporting. Anyway, these lines of code are just to make sure that the arrow doesn't remove itself. This bug shouldn't matter.
The official Minetest discussion board
https://forum.minetest.net/
Code: Select all
// 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;
}
I think many big mods will depend on this thing. get-objects-in-radius is still more hacky than using patch. Also, patch will be used only on server. Anyway, that is your chooseJeija wrote:I know this fix, i suppose it was sapier who posted it. But I would better like to wait until celeron adds this upstream. As I said, Idon't want that many dependencies for my source. I think its annoying to have to recompile the code when installing a mod. And for now, the get-objects-in.radius thing works fine.
Anyway, thanks for posting it!
Cheers, Jeija
You need to build from Sourcedarket wrote:16:42:41: ERROR[ServerThread]: ERROR: An unhandled exception occurred: LuaError: error: ...-20111209-1-win32\bin\..\data\mods\throwing\init.lua:25: attempt to call method 'get_look_dir' (a nil value)
16:42:41: ERROR[ServerThread]: stack traceback:
hmmm, maybe we need a new parameter for objects that would allow you to determine if an object was a mob or not maybe just a simple "mob = 1" or something else like "object_type = mob" if the 2nd option was used we could then also give crops "object_type = plant" or something so then the /clearobjects command could be extended to only clear objects of a certain type.Jeija wrote:Published V 0.12; MrThebuilder3's textures are default now. New minetest version that returns the objref is used. Arrows are removed after having shot a mob or a player. Arrows can kill multiple objects at the same position.
Bug: arrows can also remove items, because they are objects. Does someone have a fix for that?
+1dannydark wrote:hmmm, maybe we need a new parameter for objects that would allow you to determine if an object was a mob or not maybe just a simple "mob = 1" or something else like "object_type = mob" if the 2nd option was used we could then also give crops "object_type = plant" or something so then the /clearobjects command could be extended to only clear objects of a certain type.Jeija wrote:Published V 0.12; MrThebuilder3's textures are default now. New minetest version that returns the objref is used. Arrows are removed after having shot a mob or a player. Arrows can kill multiple objects at the same position.
Bug: arrows can also remove items, because they are objects. Does someone have a fix for that?
i.e. just clear all mobs ("/clearobjects mob" maybe) which wouldn't clear peoples crops ^_^
ZIP is very bad.Zarberman wrote:could you please post it in .zip format
http://www.mediafire.com/?5tpkmud8kjf0ckxZarberman wrote:well my computer will not let me install any file extractors so .zip files are the only ones i can use.
TAR.GZ is not extractor. Use linux. Anyway -- http://en.wikipedia.org/wiki/Tar_%28file_format%29Zarberman wrote:well my computer will not let me install any file extractors so .zip files are the only ones i can use.