Index: trunk/src/lua/lua_area.cc
===================================================================
--- trunk/src/lua/lua_area.cc	(revision 515)
+++ trunk/src/lua/lua_area.cc	(revision 520)
@@ -8,5 +8,5 @@
 
 #include "nv/lua/lua_raw.hh"
-#include "nv/core/random.hh"
+#include "nv/lua/lua_aux.hh"
 
 using nv::lua::detail::is_coord;
@@ -333,5 +333,5 @@
 	nv::sint32 xs = ( b.x - a.x ) + 1;
 	nv::sint32 ys = ( b.y - a.y ) - 1;
-	nv::sint32 roll = nv::random::get().srand( 2 * xs + 2 * ys );
+	nv::sint32 roll = nv::lua::rng().srand( 2 * xs + 2 * ys );
 	nv::ivec2 result;
 
@@ -356,5 +356,5 @@
 	nv::sint32 xs = ( b.x - a.x ) - 1;
 	nv::sint32 ys = ( b.y - a.y ) - 1;
-	nv::sint32 roll = nv::random::get().srand( 2 * xs + 2 * ys );
+	nv::sint32 roll = nv::lua::rng().srand( 2 * xs + 2 * ys );
 	nv::ivec2 result;
 
@@ -375,5 +375,5 @@
 {
 	nv::rectangle area = to_area( L, 1 );
-	push_coord( L, nv::random::get().range( area.ul, area.lr ) );
+	push_coord( L, nv::lua::rng().range( area.ul, area.lr ) );
 	return 1;
 }
@@ -383,5 +383,5 @@
 	nv::rectangle area  = to_area( L, 1 );
 	nv::ivec2     dim   = to_coord( L, 2 );
-	nv::ivec2     start = nv::random::get().range( area.ul, area.lr - dim );
+	nv::ivec2     start = nv::lua::rng().range( area.ul, area.lr - dim );
 	push_area( L, nv::rectangle( start, start + dim ) );
 	return 1;
Index: trunk/src/lua/lua_aux.cc
===================================================================
--- trunk/src/lua/lua_aux.cc	(revision 515)
+++ trunk/src/lua/lua_aux.cc	(revision 520)
@@ -9,4 +9,6 @@
 #include "nv/lua/lua_raw.hh"
 #include "nv/core/random.hh"
+
+static nv::random lua_rng;
 
 static int nluaaux_table_copy( lua_State* L )
@@ -94,5 +96,5 @@
 	if ( dice < 1 )  luaL_argerror( L, 1, "die count lower than 1!" );
 	if ( sides < 1 ) luaL_argerror( L, 2, "side count lower than 1!" );
-	lua_pushnumber( L, nv::random::get().dice( static_cast< nv::uint32 >( dice ), static_cast< nv::uint32 >( sides ) ) );
+	lua_pushnumber( L, lua_rng.dice( static_cast< nv::uint32 >( dice ), static_cast< nv::uint32 >( sides ) ) );
 	return 1;
 }
@@ -102,5 +104,5 @@
 	if ( lua_gettop( L ) == 0 )
 	{
-		lua_pushnumber( L, nv::random::get().frand(1.0f) );
+		lua_pushnumber( L, lua_rng.frand(1.0f) );
 	}
 	else
@@ -110,5 +112,5 @@
 			lua_Integer arg1 = luaL_checkinteger( L, 1 );
 			if ( arg1 < 1 ) arg1 = 1;
-			nlua_pushunsigned( L, nv::random::get().urange( 1, static_cast<nv::uint32>( arg1 ) ) );
+			nlua_pushunsigned( L, lua_rng.urange( 1, static_cast<nv::uint32>( arg1 ) ) );
 		}
 		else
@@ -116,5 +118,5 @@
 			int arg1 = static_cast< int >( luaL_checkinteger( L, 1 ) );
 			int arg2 = static_cast< int >( luaL_checkinteger( L, 2 ) );
-			int result = ( arg2 >= arg1 ? nv::random::get().srange( arg1, arg2 ) : nv::random::get().srange( arg2, arg1 ) );
+			int result = ( arg2 >= arg1 ? lua_rng.srange( arg1, arg2 ) : lua_rng.srange( arg2, arg1 ) );
 			lua_pushinteger( L, result );
 		}
@@ -125,5 +127,5 @@
 static int nluaaux_math_randomseed( lua_State* L )
 {
-	nv::random::get().set_seed( nlua_tounsigned( L, 1 ) );
+	lua_rng.set_seed( nlua_tounsigned( L, 1 ) );
 	return 0;
 }
@@ -137,4 +139,9 @@
 };
 
+nv::random & nv::lua::rng()
+{
+	return lua_rng;
+}
+
 void nv::lua::register_aux( lua::state* state )
 {
Index: trunk/src/lua/lua_map_tile.cc
===================================================================
--- trunk/src/lua/lua_map_tile.cc	(revision 515)
+++ trunk/src/lua/lua_map_tile.cc	(revision 520)
@@ -11,5 +11,5 @@
 #include "nv/stl/numeric.hh"
 #include "nv/stl/algorithm.hh"
-#include "nv/core/random.hh"
+#include "nv/lua/lua_aux.hh"
 #include "nv/lua/lua_area.hh"
 #include "nv/lua/lua_math.hh"
@@ -207,5 +207,5 @@
 static int nlua_map_tile_flip_random( lua_State* L )
 {
-	switch ( nv::random::get().urand( 4 ) )
+	switch ( nv::lua::rng().urand( 4 ) )
 	{
 	case 1 : nlua_map_tile_flip_x( L ); break;
Index: trunk/src/lua/lua_math.cc
===================================================================
--- trunk/src/lua/lua_math.cc	(revision 515)
+++ trunk/src/lua/lua_math.cc	(revision 520)
@@ -8,5 +8,5 @@
 
 #include "nv/lua/lua_raw.hh"
-#include "nv/core/random.hh"
+#include "nv/lua/lua_aux.hh"
 #include "nv/stl/type_traits/common.hh"
 
@@ -126,5 +126,5 @@
 int nlua_vec_random( lua_State* L )
 {
-	push_vec<T>( L, nv::random::get().range( to_vec<T>( L, 1 ), to_vec<T>( L, 2 ) ) );
+	push_vec<T>( L, nv::lua::rng().range( to_vec<T>( L, 1 ), to_vec<T>( L, 2 ) ) );
 	return 1;
 }
