From: Perttu Ahola Date: Wed, 4 Apr 2012 10:32:08 +0000 (+0300) Subject: Fix sound direction and add experimental:soundblock alias sb in minimal for testing X-Git-Url: http://81.2.79.47:8989/gitweb/?a=commitdiff_plain;h=a869d2345161e30163f8007b6b833bceffd98ebb;p=zefram%2Fminetest%2Fminetest_engine.git Fix sound direction and add experimental:soundblock alias sb in minimal for testing --- diff --git a/games/minimal/mods/experimental/init.lua b/games/minimal/mods/experimental/init.lua index 11f32b3f..cb0b209d 100644 --- a/games/minimal/mods/experimental/init.lua +++ b/games/minimal/mods/experimental/init.lua @@ -20,6 +20,25 @@ function switch_player_visual() end minetest.after(1.0, switch_player_visual) +minetest.register_node("experimental:soundblock", { + tile_images = {"unknown_block.png", "default_tnt_bottom.png", + "default_tnt_side.png", "default_tnt_side.png", + "default_tnt_side.png", "default_tnt_side.png"}, + inventory_image = minetest.inventorycube("unknown_block.png", + "default_tnt_side.png", "default_tnt_side.png"), +}) + +minetest.register_alias("sb", "experimental:soundblock") + +minetest.register_abm({ + nodenames = {"experimental:soundblock"}, + interval = 1, + chance = 1, + action = function(p0, node, _, _) + minetest.sound_play("default_grass_footstep", {pos=p0, gain=0.5}) + end, +}) + --[[ stepsound = -1 function test_sound() diff --git a/src/game.cpp b/src/game.cpp index a0f6c0d8..fb429beb 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -2080,7 +2080,7 @@ void the_game( // Update sound listener sound->updateListener(camera.getCameraNode()->getPosition(), v3f(0,0,0), // velocity - camera.getCameraNode()->getTarget(), + camera.getDirection(), camera.getCameraNode()->getUpVector()); /*