Merge remote-tracking branch 'eressea/server'

This commit is contained in:
TomBraun 2014-06-27 07:35:21 +02:00
commit b346788e43
10 changed files with 69 additions and 17 deletions

View File

@ -3,7 +3,7 @@
Version="10.0"
VendorName="SlickEdit"
TemplateName="GNU C/C++"
WorkingDir="."
WorkingDir="../"
BuildSystem="vsbuild">
<Config
Name="Debug"
@ -69,7 +69,9 @@
Deletable="0"
SaveOption="SaveNone"
RunFromDir="%rw">
<Exec CmdLine='vsdebugio -prog "%o"'/>
<Exec
CmdLine='vsdebugio -prog "%o" %~other'
OtherOptions="scripts/runtests.lua"/>
</Target>
<Target
Name="Execute"
@ -79,9 +81,10 @@
CaptureOutputWith="ProcessBuffer"
Deletable="0"
SaveOption="SaveWorkspaceFiles"
RunFromDir="%rw"
RunInXterm="1">
<Exec CmdLine='"%o"'/>
RunFromDir="%rw">
<Exec
CmdLine='"%o" %~other'
OtherOptions="scripts/runtests.lua"/>
</Target>
<Target
Name="dash"
@ -194,7 +197,9 @@
Deletable="0"
SaveOption="SaveNone"
RunFromDir="%rw">
<Exec CmdLine='vsdebugio -prog "%o"'/>
<Exec
CmdLine='vsdebugio -prog "%o" %~other'
OtherOptions="scripts/runtests.lua"/>
</Target>
<Target
Name="Execute"
@ -204,9 +209,10 @@
CaptureOutputWith="ProcessBuffer"
Deletable="0"
SaveOption="SaveWorkspaceFiles"
RunFromDir="%rw"
RunInXterm="1">
<Exec CmdLine='"%o"'/>
RunFromDir="%rw">
<Exec
CmdLine='"%o" %~other'
OtherOptions="scripts/runtests.lua"/>
</Target>
<Target
Name="dash"
@ -282,6 +288,7 @@
<F N="../src/config.pkg.c"/>
<F N="../src/console.c"/>
<F N="../src/eressea.pkg.c"/>
<F N="../src/game.pkg.c"/>
<F N="../src/gmtool.c"/>
<F N="../src/helpers.c"/>
<F N="../src/listbox.c"/>

View File

@ -21,7 +21,9 @@ static char *strip(char *str) {
for (; *b && isspace(*b); ++b) {};
for (e = b; *e && !isspace(*e); ++e) {};
while (*b) {
if (s!=b) {
memcpy(s, b, e - b);
}
s += e - b;
for (b = e; *b && isspace(*b); ++b) {};
for (e = b; *e && !isspace(*e); ++e) {};

View File

@ -117,8 +117,13 @@ extern "C" {
typedef struct weapon {
int count, used;
const struct weapon_type *type;
# ifdef LOMEM
int attackskill:8;
int defenseskill:8;
# else
int attackskill;
int defenseskill;
# endif
} weapon;
/*** fighter::person::flags ***/
@ -165,6 +170,7 @@ extern "C" {
int catmsg; /* Merkt sich, ob Katapultmessage schon generiert. */
struct person {
int hp; /* Trefferpunkte der Personen */
#ifdef LOMEM
int attack:8; /* (Magie) Attackenbonus der Personen */
int defence:8; /* (Magie) Paradenbonus der Personen */
int damage:8; /* (Magie) Schadensbonus der Personen im Nahkampf */
@ -174,6 +180,16 @@ extern "C" {
int reload:4; /* Anzahl Runden, die die Waffe x noch laden muss.
* dahinter steckt ein array[RL_MAX] wenn er min. eine hat. */
int last_action:4; /* In welcher Runde haben wir zuletzt etwas getan */
#else
int attack;
int defence;
int damage;
int damage_rear;
int flags;
int speed;
int reload;
int last_action;
#endif
struct weapon *missile; /* missile weapon */
struct weapon *melee; /* melee weapon */
} *person;

View File

@ -2103,7 +2103,7 @@ bool faction_id_is_unused(int id)
int weight(const unit * u)
{
int w, n = 0, in_bag = 0;
int w = 0, n = 0, in_bag = 0;
const resource_type *rtype = get_resourcetype(R_SACK_OF_CONSERVATION);
item *itm;
@ -2120,8 +2120,8 @@ int weight(const unit * u)
if (rtype) {
w = i_get(u->items, rtype->itype) * BAGCAPACITY;
if (w > in_bag) w = in_bag;
}
n -= w;
}
return n;
}

View File

@ -260,9 +260,6 @@ void json_race(cJSON *json, race *rc) {
else if (strcmp(child->string, "weight")==0) {
rc->weight = child->valueint;
}
else if (strcmp(child->string, "speed")==0) {
rc->speed = child->valueint;
}
else if (strcmp(child->string, "capacity")==0) {
rc->capacity = child->valueint;
}

View File

@ -45,8 +45,13 @@ static int nlocales = 0;
typedef struct order_data {
char *_str;
# ifdef LOMEM
int _refcount:20;
int _lindex:4;
# else
int _refcount;
int _lindex;
# endif
keyword_t _keyword;
} order_data;

View File

@ -22,12 +22,21 @@ extern "C" {
typedef struct rawmaterial {
const struct rawmaterial_type *type;
#ifdef LOMEM
int amount:16;
int level:8;
int flags:8;
int base:8;
int divisor:8;
int startlevel:8;
#else
int amount;
int level;
int flags;
int base;
int divisor;
int startlevel;
#endif
struct rawmaterial *next;
} rawmaterial;

View File

@ -25,10 +25,17 @@ extern "C" {
#define SMF_RIDING (1<<2) /* Bonus für berittene - an der rasse */
typedef struct skill {
#ifdef LOMEM
int id:8;
unsigned int level:8;
unsigned int weeks:8;
unsigned int old:8;
#else
int id;
unsigned int level;
unsigned int weeks;
unsigned int old;
#endif
} skill;
typedef int (*skillmod_fun) (const struct unit *, const struct region *,

View File

@ -19,6 +19,10 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#ifndef CONFIG_H
#define CONFIG_H
#ifdef NDEBUG
#define LOMEM
#endif
#ifdef _MSC_VER
# define VC_EXTRALEAN
# define WIN32_LEAN_AND_MEAN

View File

@ -9,7 +9,12 @@ function setup()
eressea.settings.set("rules.ships.storms", "0")
conf = [[{
"races": {
"human" : { "speed" : 1, "flags" : [ "walk" ] },
"human" : {
"speed" : 1,
"weight" : 1000,
"capacity" : 1500,
"flags" : [ "walk" ]
},
"troll" : {}
},
"items" : {
@ -44,7 +49,7 @@ end
function test_walk_to_land()
local r1 = region.create(0, 0, "plain")
local r2 = region.create(1, 0, "plain")
local f = faction.create("test@example.com", "human", "de")
local f = faction.create("walk@example.com", "human", "de")
local u = unit.create(f, r1, 1)
u:add_order("NACH O")
process_orders()