diff --git a/game-e3/catalog.xml b/game-e3/catalog.xml
new file mode 100644
index 000000000..93cda3505
--- /dev/null
+++ b/game-e3/catalog.xml
@@ -0,0 +1,16 @@
+
+
+
+
+
+
+
+
diff --git a/game-e3/config.xml b/game-e3/config.xml
new file mode 100644
index 000000000..5b3ea01bc
--- /dev/null
+++ b/game-e3/config.xml
@@ -0,0 +1,183 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ eressea-server@eressea.de
+ eressea-server@eressea.de
+
+
+ Bitte denke daran, deine Befehle mit dem Betreff
+ ERESSEA 4 BEFEHLE an eressea-server@eressea.de zu senden.
+ Remember to send your orders to
+ eressea-server@eressea.de with the subject ERESSEA 4 ORDERS.
+
+
+ ERESSEA 4 BEFEHLE
+ ERESSEA 4 ORDERS
+
+
+
diff --git a/game-e3/eressea.ini b/game-e3/eressea.ini
index efc181a02..ddae64c0e 100644
--- a/game-e3/eressea.ini
+++ b/game-e3/eressea.ini
@@ -1,6 +1,5 @@
[eressea]
base = .
-load = setup.lua
report = reports
verbose = 0
lomem = 0
diff --git a/res/e3a/buildings.xml b/res/e3a/buildings.xml
index f87987ac1..b3e59f0a4 100644
--- a/res/e3a/buildings.xml
+++ b/res/e3a/buildings.xml
@@ -1,7 +1,7 @@
-
+
diff --git a/res/e3a/races.xml b/res/e3a/races.xml
index 3c28a2319..0e5166d42 100644
--- a/res/e3a/races.xml
+++ b/res/e3a/races.xml
@@ -3,11 +3,35 @@
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -583,29 +607,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/res/e3a/resources.xml b/res/e3a/resources.xml
index bd71f8c5d..4ab29a5b6 100644
--- a/res/e3a/resources.xml
+++ b/res/e3a/resources.xml
@@ -2,13 +2,13 @@
-
-
-
-
-
-
-
+
+
+
+
+
+
+
diff --git a/res/e3a/weapons.xml b/res/e3a/weapons.xml
index 687d12d21..91748d64e 100644
--- a/res/e3a/weapons.xml
+++ b/res/e3a/weapons.xml
@@ -1,25 +1,25 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/s/build b/s/build
index cd2b7d8cc..b6701cb87 100755
--- a/s/build
+++ b/s/build
@@ -4,9 +4,12 @@ while [ ! -d $ROOT/.git ]; do
ROOT=$(dirname $ROOT)
done
+MACHINE=`uname -m`
[ -z "$CC" ] && [ ! -z `which gcc` ] && CC="gcc"
[ -z "$CC" ] && [ ! -z `which tcc` ] && CC="tcc"
[ -z "$CC" ] && [ ! -z `which cc` ] && CC="cc"
+BIN_DIR="build-$MACHINE-$CC-Debug"
+
[ -z "$JOBS" ] && JOBS=$(nproc)
DISTCC=`which distcc`
if [ ! -z "$DISTCC" ] ; then
@@ -20,8 +23,6 @@ fi
fi
echo "Building with $CC and $JOBS jobs"
-MACHINE=`uname -m`
-BIN_DIR="build-$MACHINE-$CC-Debug"
if [ ! -d $ROOT/$BIN_DIR ]; then
echo "cannot find build directory $BIN_DIR in $ROOT. did you run cmake-init?"
exit
diff --git a/s/install b/s/install
new file mode 100755
index 000000000..359254e6a
--- /dev/null
+++ b/s/install
@@ -0,0 +1,19 @@
+#!/bin/sh
+ROOT=$(pwd)
+while [ ! -d $ROOT/.git ]; do
+ ROOT=$(dirname $ROOT)
+ if [ "$ROOT" == "/" ; then
+ echo "could not find root, are you in the git repository?"
+ exit
+ fi
+done
+
+MACHINE=`uname -m`
+[ -z "$CC" ] && [ ! -z `which gcc` ] && CC="gcc"
+[ -z "$CC" ] && [ ! -z `which tcc` ] && CC="tcc"
+[ -z "$CC" ] && [ ! -z `which cc` ] && CC="cc"
+BIN_DIR="build-$MACHINE-$CC-Debug"
+
+cd $ROOT/$BIN_DIR
+make install
+cd -
diff --git a/s/runtests b/s/runtests
new file mode 100755
index 000000000..1ad5a0b0a
--- /dev/null
+++ b/s/runtests
@@ -0,0 +1,24 @@
+#!/bin/bash
+ROOT=$(pwd)
+while [ ! -d $ROOT/.git ]; do
+ ROOT=$(dirname $ROOT)
+done
+
+MACHINE=`uname -m`
+[ -z "$CC" ] && [ ! -z `which gcc` ] && CC="gcc"
+[ -z "$CC" ] && [ ! -z `which tcc` ] && CC="tcc"
+[ -z "$CC" ] && [ ! -z `which cc` ] && CC="cc"
+BIN_DIR="build-$MACHINE-$CC-Debug"
+
+if [ ! -d $ROOT/$BIN_DIR ]; then
+ echo "cannot find build directory $BIN_DIR in $ROOT. did you run cmake-init?"
+ exit
+fi
+
+echo $ROOT
+$ROOT/$BIN_DIR/eressea/test_eressea
+pushd $ROOT/game-e2
+$ROOT/$BIN_DIR/eressea/eressea -e run_tests
+cd $ROOT/game-e3
+$ROOT/$BIN_DIR/eressea/eressea -e run_tests
+popd
diff --git a/src/bind_ship.c b/src/bind_ship.c
index bcab0d794..d268c88c6 100644
--- a/src/bind_ship.c
+++ b/src/bind_ship.c
@@ -177,6 +177,13 @@ static int tolua_ship_get_coast(lua_State * L)
return 0;
}
+static int tolua_ship_get_type(lua_State * L)
+{
+ ship *self = (ship *) tolua_tousertype(L, 1, 0);
+ tolua_pushstring(L, self->type->name[0]);
+ return 1;
+}
+
void tolua_ship_open(lua_State * L)
{
/* register user types */
@@ -201,8 +208,8 @@ void tolua_ship_open(lua_State * L)
tolua_ship_set_region);
tolua_variable(L, TOLUA_CAST "coast", tolua_ship_get_coast,
tolua_ship_set_coast);
+ tolua_variable(L, TOLUA_CAST "type", tolua_ship_get_type, 0);
#ifdef TODO
- .property("type", &ship_gettype)
.property("weight", &ship_getweight)
.property("capacity", &ship_getcapacity)
.property("maxsize", &ship_maxsize)
diff --git a/src/bindings.c b/src/bindings.c
index bcf7f76f3..7a8e99e3a 100755
--- a/src/bindings.c
+++ b/src/bindings.c
@@ -1198,33 +1198,36 @@ lua_State *lua_init(void) {
int eressea_run(lua_State *L, const char *luafile, const char *entry_point)
{
- int err = 0;
+ int err = 0;
- global.vm_state = L;
- /* run the main script */
- if (luafile) {
- log_debug("executing script %s\n", luafile);
- lua_getglobal(L, "dofile");
- lua_pushstring(L, luafile);
- err = lua_pcall(L, 1, 0, 0);
- if (err != 0) {
- log_lua_error(L);
- abort();
- return err;
+ global.vm_state = L;
+ /* run the main script */
+ if (luafile) {
+ log_debug("executing script %s\n", luafile);
+ lua_getglobal(L, "dofile");
+ lua_pushstring(L, luafile);
+ err = lua_pcall(L, 1, 0, 0);
+ if (err != 0) {
+ log_lua_error(L);
+ abort();
+ return err;
+ }
}
- }
- if (entry_point) {
- lua_getglobal(L, entry_point);
- if (lua_isfunction(L, -1)) {
- log_debug("calling entry-point: %s\n", entry_point);
- err = lua_pcall(L, 0, 1, 0);
- if (err != 0) {
- log_lua_error(L);
- }
- return err;
- } else {
- log_error("unknown entry-point: %s\n", entry_point);
+ if (entry_point) {
+ if (strcmp("console", entry_point)==0) {
+ return lua_console(L);
+ }
+ lua_getglobal(L, entry_point);
+ if (lua_isfunction(L, -1)) {
+ log_debug("calling entry-point: %s\n", entry_point);
+ err = lua_pcall(L, 0, 1, 0);
+ if (err != 0) {
+ log_lua_error(L);
+ }
+ return err;
+ } else {
+ log_error("unknown entry-point: %s\n", entry_point);
+ }
}
- }
- return lua_console(L);
+ return 0;
}
diff --git a/src/main.c b/src/main.c
index 8685ca0c9..34f5aa77f 100644
--- a/src/main.c
+++ b/src/main.c
@@ -73,6 +73,7 @@ static int usage(const char *prog, const char *arg)
}
fprintf(stderr, "Usage: %s [options]\n"
"-t : read this datafile, not the most current one\n"
+ "-f : execute a lua script\n"
"-q : be quite (same as -v 0)\n"
"-v : verbosity level\n"
"-C : run in interactive mode\n"
@@ -118,7 +119,10 @@ static int parse_args(int argc, char **argv, int *exitcode)
const char *arg;
switch (argv[i][1]) {
case 'C':
- entry_point = NULL;
+ entry_point = "console";
+ break;
+ case 'f':
+ i = get_arg(argc, argv, 2, i, &luafile, 0);
break;
case 'l':
i = get_arg(argc, argv, 2, i, &logfile, 0);
diff --git a/src/util/xml.c b/src/util/xml.c
index 2339733fa..c97460912 100644
--- a/src/util/xml.c
+++ b/src/util/xml.c
@@ -118,7 +118,7 @@ int read_xml(const char *filename, const char *catalog)
doc = xmlParseFile(filename);
#endif
if (doc == NULL) {
- log_error("could not open %s\n", filename);
+ log_error("could not open '%s'\n", filename);
return -1;
}