Merge branch 'master' of github.com:eressea/server

This commit is contained in:
Enno Rehling 2014-06-26 22:06:38 -07:00
commit 39f78354b9
6 changed files with 44 additions and 1 deletions

View File

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

View File

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

View File

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

View File

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

View File

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