diff --git a/CMakeLists.txt b/CMakeLists.txt index 2d2635f05..9bd567d24 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -48,7 +48,9 @@ endif() find_package(EXPAT REQUIRED) find_package (ToLua REQUIRED) if (TOLUA_FOUND) -if (${TOLUA_VERSION_STRING} VERSION_EQUAL "5.2") +if (${TOLUA_VERSION_STRING} VERSION_EQUAL "5.3") +find_package (Lua 5.3 REQUIRED) +elseif (${TOLUA_VERSION_STRING} VERSION_EQUAL "5.2") find_package (Lua 5.2 REQUIRED) else () find_package (Lua51 REQUIRED) diff --git a/s/cmake-init b/s/cmake-init index 22d98b42e..a8228c379 100755 --- a/s/cmake-init +++ b/s/cmake-init @@ -79,13 +79,16 @@ git submodule update --init LUA_VERSION="5.2" LUA_INCLUDE=/usr/include LUA_DIR=/usr -if [ -d /usr/include/lua5.1 ]; then - LUA_VERSION="5.1" - LUA_INCLUDE=/usr/include/lua5.1 +if [ -d /usr/local/include/lua5.3 ]; then + LUA_VERSION="5.3" + LUA_INCLUDE=/usr/local/include/lua5.3 elif [ -d /usr/include/lua5.2 ]; then export LUA_DIR=/usr LUA_VERSION="5.2" LUA_INCLUDE=/usr/include/lua5.2 +elif [ -d /usr/include/lua5.1 ]; then + LUA_VERSION="5.1" + LUA_INCLUDE=/usr/include/lua5.1 elif [ -d /usr/local/include/lua5.1 ]; then export LUA_DIR=/usr/local LUA_VERSION="5.1" diff --git a/src/laws.c b/src/laws.c index fc1c8dc88..01aa4be8d 100644 --- a/src/laws.c +++ b/src/laws.c @@ -684,7 +684,7 @@ growing_trees(region * r, const season_t current_season, const season_t last_wee a->data.sa[0] = (short)cap_int(rtrees(r, 0), 0, SHRT_MAX); a->data.sa[1] = (short)cap_int(rtrees(r, 1), 0, SHRT_MAX); } - else if (a->data.sa[0] < 0 || a->data.sa[1] << 0) { + else if (a->data.sa[0] < 0 || a->data.sa[1] < 0) { a->data.sa[0] = (short)cap_int(a->data.sa[0], 0, SHRT_MAX); a->data.sa[1] = (short)cap_int(a->data.sa[1], 0, SHRT_MAX); }