Changeset 367 for trunk/src/lua/lua_aux.cc
- Timestamp:
- 05/16/15 23:12:22 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lua/lua_aux.cc
r319 r367 7 7 #include "nv/lua/lua_aux.hh" 8 8 9 #include <utility>10 9 #include "nv/lua/lua_raw.hh" 11 10 #include "nv/core/random.hh" … … 117 116 int arg1 = static_cast< int >( luaL_checkinteger( L, 1 ) ); 118 117 int arg2 = static_cast< int >( luaL_checkinteger( L, 2 ) ); 119 i f (arg2 < arg1) std::swap( arg2, arg1);120 lua_pushinteger( L, nv::random::get().srange( arg1, arg2 ));118 int result = ( arg2 >= arg1 ? nv::random::get().srange( arg1, arg2 ) : nv::random::get().srange( arg2, arg1 ) ); 119 lua_pushinteger( L, result ); 121 120 } 122 121 }
Note: See TracChangeset
for help on using the changeset viewer.