From 544aeb08404f8bb6848f64140909715afbf7d1f1 Mon Sep 17 00:00:00 2001 From: teddydestodes Date: Sun, 29 May 2011 19:17:42 +0200 Subject: fast_move and free_move can now be toggled --- src/game.cpp | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'src/game.cpp') diff --git a/src/game.cpp b/src/game.cpp index 603a86da3..7970a6ed9 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -1147,6 +1147,28 @@ void the_game( &g_menumgr, dest, L""))->drop(); } + else if(input->wasKeyDown(getKeySetting("keymap_freemove"))) + { + if(g_settings.getBool("free_move")) + { + g_settings.set("free_move","false"); + } + else + { + g_settings.set("free_move","true"); + } + } + else if(input->wasKeyDown(getKeySetting("keymap_fastmove"))) + { + if(g_settings.getBool("fast_move")) + { + g_settings.set("fast_move","false"); + } + else + { + g_settings.set("fast_move","true"); + } + } // Item selection with mouse wheel { -- cgit v1.2.3 From 158b054e72582005d895f1ed0e1cb0c9b22a8e57 Mon Sep 17 00:00:00 2001 From: Nils Dagsson Moskopp Date: Wed, 8 Jun 2011 05:27:51 +0200 Subject: + rail block bounding box --- src/game.cpp | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) (limited to 'src/game.cpp') diff --git a/src/game.cpp b/src/game.cpp index 7970a6ed9..bbd0a22ef 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -530,6 +530,43 @@ void getPointedNode(Client *client, v3f player_position, } } } + else if(n.d == CONTENT_RAIL) + { + v3s16 dir = unpackDir(n.dir); + v3f dir_f = v3f(dir.X, dir.Y, dir.Z); + dir_f *= BS/2 - BS/6 - BS/20; + v3f cpf = npf + dir_f; + f32 distance = (cpf - camera_position).getLength(); + + float d = (float)BS/16; + v3f vertices[4] = + { + v3f(BS/2, -BS/2+d, -BS/2), + v3f(-BS/2, -BS/2, BS/2), + }; + + for(s32 i=0; i<2; i++) + { + vertices[i] += npf; + } + + core::aabbox3d box; + + box = core::aabbox3d(vertices[0]); + box.addInternalPoint(vertices[1]); + + if(distance < mindistance) + { + if(box.intersectsWithLine(shootline)) + { + nodefound = true; + nodepos = np; + neighbourpos = np; + mindistance = distance; + nodehilightbox = box; + } + } + } /* Regular blocks */ -- cgit v1.2.3