forked from github/server
do not run tolua inside MSVC
The cmake rules for this do not work.
This commit is contained in:
parent
e9bc92608c
commit
e8b28725e1
38
README.md
38
README.md
|
@ -1,20 +1,20 @@
|
|||
# What is this?
|
||||
|
||||
This repository contains an the source code for the Play-by-Mail strategy game [Eressea](http://www.eressea.de/).
|
||||
|
||||
# Prerequisites
|
||||
|
||||
Eressea depends on a number of external libraries. On a recent Debian-based Linux system, this is the apt-get command to install all of them:
|
||||
|
||||
sudo apt-get install git cmake gcc make libxml2-dev liblua5.2-dev libtolua-dev libncurses5-dev libsqlite3-dev
|
||||
|
||||
# How to check out and build the Eressea server
|
||||
|
||||
This repository relies heavily on the use of submodules, and it pulls in most of the code from those. The build system being used is cmake, which can create Makefiles on Unix, or Visual Studio project files on Windows. Here's how you clone and build the source on Ubuntu:
|
||||
|
||||
git clone git://github.com/eressea/server.git
|
||||
cd server
|
||||
git submodule update --init
|
||||
./configure
|
||||
|
||||
# What is this?
|
||||
|
||||
This repository contains an the source code for the Play-by-Mail strategy game [Eressea](http://www.eressea.de/).
|
||||
|
||||
# Prerequisites
|
||||
|
||||
Eressea depends on a number of external libraries. On a recent Debian-based Linux system, this is the apt-get command to install all of them:
|
||||
|
||||
sudo apt-get install git cmake gcc make libxml2-dev liblua5.2-dev libtolua-dev libncurses5-dev libsqlite3-dev
|
||||
|
||||
# How to check out and build the Eressea server
|
||||
|
||||
This repository relies heavily on the use of submodules, and it pulls in most of the code from those. The build system being used is cmake, which can create Makefiles on Unix, or Visual Studio project files on Windows. Here's how you clone and build the source on Ubuntu:
|
||||
|
||||
git clone git://github.com/eressea/server.git
|
||||
cd server
|
||||
git submodule update --init
|
||||
./configure
|
||||
|
||||
If you got this far and all went well, you have built a server (it is linked from the `game` subdirectory), and it will have passed some basic functionality tests.
|
|
@ -1,52 +1,52 @@
|
|||
module('frost', package.seeall)
|
||||
|
||||
local function is_winter(turn)
|
||||
local season = get_season(turn)
|
||||
return season == "calendar::winter"
|
||||
end
|
||||
|
||||
local function is_spring(turn)
|
||||
local season = get_season(turn)
|
||||
return season == "calendar::spring"
|
||||
end
|
||||
|
||||
local function freeze(r, chance)
|
||||
for i, rn in ipairs(r.adj) do
|
||||
-- each region has a chance to freeze
|
||||
if rn.terrain=="ocean" and (chance>=100 or math.fmod(rng_int(), 100)<chance) then
|
||||
rn.terrain = "packice"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
local function thaw(r, chance)
|
||||
if chance>=100 or math.fmod(rng_int(), 100)<chance then
|
||||
r.terrain = "ocean"
|
||||
for s in r.ships do
|
||||
s.coast = nil
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function update()
|
||||
local turn = get_turn()
|
||||
if is_winter(turn) then
|
||||
for r in regions() do
|
||||
if r.terrain=="glacier" then
|
||||
freeze(r, 20)
|
||||
end
|
||||
end
|
||||
elseif is_spring(turn) then
|
||||
for r in regions() do
|
||||
if r.terrain=="packice" then
|
||||
thaw(r, 20)
|
||||
end
|
||||
end
|
||||
elseif is_spring(turn-1) then
|
||||
for r in regions() do
|
||||
if r.terrain=="packice" then
|
||||
thaw(r, 100)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
module('frost', package.seeall)
|
||||
|
||||
local function is_winter(turn)
|
||||
local season = get_season(turn)
|
||||
return season == "calendar::winter"
|
||||
end
|
||||
|
||||
local function is_spring(turn)
|
||||
local season = get_season(turn)
|
||||
return season == "calendar::spring"
|
||||
end
|
||||
|
||||
local function freeze(r, chance)
|
||||
for i, rn in ipairs(r.adj) do
|
||||
-- each region has a chance to freeze
|
||||
if rn.terrain=="ocean" and (chance>=100 or math.fmod(rng_int(), 100)<chance) then
|
||||
rn.terrain = "packice"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
local function thaw(r, chance)
|
||||
if chance>=100 or math.fmod(rng_int(), 100)<chance then
|
||||
r.terrain = "ocean"
|
||||
for s in r.ships do
|
||||
s.coast = nil
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function update()
|
||||
local turn = get_turn()
|
||||
if is_winter(turn) then
|
||||
for r in regions() do
|
||||
if r.terrain=="glacier" then
|
||||
freeze(r, 20)
|
||||
end
|
||||
end
|
||||
elseif is_spring(turn) then
|
||||
for r in regions() do
|
||||
if r.terrain=="packice" then
|
||||
thaw(r, 20)
|
||||
end
|
||||
end
|
||||
elseif is_spring(turn-1) then
|
||||
for r in regions() do
|
||||
if r.terrain=="packice" then
|
||||
thaw(r, 100)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -43,7 +43,6 @@ MACRO(ADD_LUA_MODULE MODULE_NAME FILES)
|
|||
)
|
||||
ENDMACRO(ADD_LUA_MODULE)
|
||||
|
||||
IF(TOLUA_FOUND)
|
||||
MACRO(TOLUA_BINDING PKGFILE FILES)
|
||||
ADD_CUSTOM_COMMAND(
|
||||
OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/${PKGFILE}.c
|
||||
|
@ -54,10 +53,11 @@ MACRO(TOLUA_BINDING PKGFILE FILES)
|
|||
)
|
||||
ENDMACRO(TOLUA_BINDING)
|
||||
|
||||
IF(NOT MSVC)
|
||||
TOLUA_BINDING(process.pkg bind_process.h)
|
||||
TOLUA_BINDING(eressea.pkg bind_eressea.h)
|
||||
TOLUA_BINDING(settings.pkg bind_settings.h)
|
||||
ENDIF(TOLUA_FOUND)
|
||||
ENDIF()
|
||||
|
||||
set(TESTS
|
||||
laws_test.c
|
||||
|
|
Loading…
Reference in New Issue