Ignore:
Timestamp:
05/16/15 23:12:22 (10 years ago)
Author:
epyon
Message:
  • fixed compilation and warnings on gcc
  • slowly removing/merging external includes
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/lua/lua_aux.cc

    r319 r367  
    77#include "nv/lua/lua_aux.hh"
    88
    9 #include <utility>
    109#include "nv/lua/lua_raw.hh"
    1110#include "nv/core/random.hh"
     
    117116                        int arg1 = static_cast< int >( luaL_checkinteger( L, 1 ) );
    118117                        int arg2 = static_cast< int >( luaL_checkinteger( L, 2 ) );
    119                         if (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 );
    121120                }
    122121        }
Note: See TracChangeset for help on using the changeset viewer.