diff options
author | Kahrl <kahrl@gmx.net> | 2011-12-04 03:28:30 +0100 |
---|---|---|
committer | Perttu Ahola <celeron55@gmail.com> | 2011-12-04 13:27:30 +0200 |
commit | ceaf8edaded4c9e8f2e6fa285d9765e7095df332 (patch) | |
tree | 529f11ffc0a7306f828f7e811494fac3b03803bc /data/mods/default | |
parent | 520200d5978e4a870d9cbd8a7b71883e4329711b (diff) | |
download | minetest-ceaf8edaded4c9e8f2e6fa285d9765e7095df332.tar.gz minetest-ceaf8edaded4c9e8f2e6fa285d9765e7095df332.tar.bz2 minetest-ceaf8edaded4c9e8f2e6fa285d9765e7095df332.zip |
Use plain IBillboardSceneNode instead of MyBillboardSceneNode (improves
Irrlicht 1.8 compat); also find dungeon master's fireball texture
again; add /spawnentity command
Diffstat (limited to 'data/mods/default')
-rw-r--r-- | data/mods/default/init.lua | 22 | ||||
-rw-r--r-- | data/mods/default/textures/default_fireball.png | bin | 603 -> 0 bytes |
2 files changed, 22 insertions, 0 deletions
diff --git a/data/mods/default/init.lua b/data/mods/default/init.lua index a843063ef..7f0614e20 100644 --- a/data/mods/default/init.lua +++ b/data/mods/default/init.lua @@ -1472,6 +1472,28 @@ minetest.register_on_chat_message(function(name, message) end return true -- Handled chat message end + local cmd = "/spawnentity" + if message:sub(0, #cmd) == cmd then + if not minetest.get_player_privs(name)["give"] then + minetest.chat_send_player(name, "you don't have permission to spawn (give)") + return true -- Handled chat message + end + local entityname = string.match(message, cmd.." (.*)") + if entityname == nil then + minetest.chat_send_player(name, 'usage: '..cmd..' entityname') + return true -- Handled chat message + end + print(cmd..' invoked, entityname="'..entityname..'"') + local player = minetest.env:get_player_by_name(name) + if player == nil then + print("Unable to spawn entity, player is nil") + return true -- Handled chat message + end + minetest.env:add_luaentity(player:getpos(), entityname) + minetest.chat_send_player(name, '"'..entityname + ..'" spawned.'); + return true -- Handled chat message + end end) -- diff --git a/data/mods/default/textures/default_fireball.png b/data/mods/default/textures/default_fireball.png Binary files differdeleted file mode 100644 index 523142850..000000000 --- a/data/mods/default/textures/default_fireball.png +++ /dev/null |