Merge branch 'develop' of github.com:ennorehling/eressea into develop

This commit is contained in:
Enno Rehling 2020-05-03 17:06:21 +02:00
commit 93cdeae2a8
3 changed files with 10 additions and 5 deletions

View File

@ -48,7 +48,9 @@ endif()
find_package(EXPAT REQUIRED) find_package(EXPAT REQUIRED)
find_package (ToLua REQUIRED) find_package (ToLua REQUIRED)
if (TOLUA_FOUND) 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) find_package (Lua 5.2 REQUIRED)
else () else ()
find_package (Lua51 REQUIRED) find_package (Lua51 REQUIRED)

View File

@ -79,13 +79,16 @@ git submodule update --init
LUA_VERSION="5.2" LUA_VERSION="5.2"
LUA_INCLUDE=/usr/include LUA_INCLUDE=/usr/include
LUA_DIR=/usr LUA_DIR=/usr
if [ -d /usr/include/lua5.1 ]; then if [ -d /usr/local/include/lua5.3 ]; then
LUA_VERSION="5.1" LUA_VERSION="5.3"
LUA_INCLUDE=/usr/include/lua5.1 LUA_INCLUDE=/usr/local/include/lua5.3
elif [ -d /usr/include/lua5.2 ]; then elif [ -d /usr/include/lua5.2 ]; then
export LUA_DIR=/usr export LUA_DIR=/usr
LUA_VERSION="5.2" LUA_VERSION="5.2"
LUA_INCLUDE=/usr/include/lua5.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 elif [ -d /usr/local/include/lua5.1 ]; then
export LUA_DIR=/usr/local export LUA_DIR=/usr/local
LUA_VERSION="5.1" LUA_VERSION="5.1"

View File

@ -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[0] = (short)cap_int(rtrees(r, 0), 0, SHRT_MAX);
a->data.sa[1] = (short)cap_int(rtrees(r, 1), 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[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); a->data.sa[1] = (short)cap_int(a->data.sa[1], 0, SHRT_MAX);
} }