Lauter kleine Angleichungen an den HEAD-Code, damit die diffs kleiner bleiben.

Eigentlich keine Änderung. Gleich mal testen.
This commit is contained in:
Enno Rehling 2004-04-11 23:56:47 +00:00
parent 82119094a7
commit f3244cd6c8
32 changed files with 6317 additions and 6596 deletions

View File

@ -117,7 +117,8 @@ RemoveNMRNewbie(void) {
static void static void
restart(unit *u, const race * rc) restart(unit *u, const race * rc)
{ {
faction *f = addfaction(u->faction->email, u->faction->passw, rc, u->faction->locale, u->faction->subscription); faction * oldf = u->faction;
faction *f = addfaction(oldf->email, oldf->passw, rc, oldf->locale, oldf->subscription);
unit * nu = addplayer(u->region, f); unit * nu = addplayer(u->region, f);
strlist ** o=&u->orders; strlist ** o=&u->orders;
f->subscription = u->faction->subscription; f->subscription = u->faction->subscription;
@ -911,11 +912,9 @@ iron(region * r)
#ifndef NO_GROWTH #ifndef NO_GROWTH
if (rterrain(r) == T_MOUNTAIN) { if (rterrain(r) == T_MOUNTAIN) {
rsetiron(r, riron(r) + IRONPERTURN); rsetiron(r, riron(r) + IRONPERTURN);
#if !NEW_LAEN
if(a_find(r->attribs, &at_laen)) { if(a_find(r->attribs, &at_laen)) {
rsetlaen(r, rlaen(r) + rand() % MAXLAENPERTURN); rsetlaen(r, rlaen(r) + rand() % MAXLAENPERTURN);
} }
#endif
} else if (rterrain(r) == T_GLACIER || rterrain(r) == T_ICEBERG_SLEEP) { } else if (rterrain(r) == T_GLACIER || rterrain(r) == T_ICEBERG_SLEEP) {
rsetiron(r, min(MAXGLIRON, riron(r)+GLIRONPERTURN)); rsetiron(r, min(MAXGLIRON, riron(r)+GLIRONPERTURN));
} }
@ -2719,7 +2718,6 @@ renumber_factions(void)
for (rp=renum;rp;rp=rp->next) { for (rp=renum;rp;rp=rp->next) {
f = rp->faction; f = rp->faction;
a_remove(&f->attribs, rp->attrib); a_remove(&f->attribs, rp->attrib);
if (updatelog) fprintf(updatelog, "renum %s %s\n", itoa36(f->no), itoa36(rp->want));
if (f->subscription) fprintf(sqlstream, "UPDATE subscriptions set faction='%s' where " if (f->subscription) fprintf(sqlstream, "UPDATE subscriptions set faction='%s' where "
"id=%u;\n", itoa36(rp->want), "id=%u;\n", itoa36(rp->want),
f->subscription); f->subscription);
@ -3646,11 +3644,6 @@ processorders (void)
monthly_healing(); monthly_healing();
regeneration_magiepunkte(); regeneration_magiepunkte();
#if NEW_LAEN
puts(" - Laenwachstum");
growlaen();
#endif
puts(" - Defaults setzen"); puts(" - Defaults setzen");
defaultorders(); defaultorders();

View File

@ -1528,64 +1528,3 @@ randomevents(void)
check_split(); check_split();
check_luck(); check_luck();
} }
#if NEW_LAEN
void growlaen(void) {
region *r;
region_list *Berge=NULL, *rl;
unit *u;
int b=0, Laen, z, add;
short *add_laen;
for (r = regions; r; r = r->next) {
if (!fval(r, RF_CHAOTIC) &&
rterrain(r) == T_MOUNTAIN)
{
add_regionlist(&Berge,r);
b++;
}
}
add_laen=(short *)malloc(b*sizeof(short));
memset(add_laen, 0, b*sizeof(short));
Laen=b*MAXLAENPERTURN/14; /* Anzahl Berge * MAXLAENPERTURN/2 * Chance pro Berg */
while(Laen) { /* Laenverteilung über alle Berge */
z = rand()%b;
add = min(10 + rand() % 30, Laen);
add_laen[z] = (short)(add_laen[z]+add);
Laen -= add;
}
z=0;
for (rl=Berge; rl; rl=rl->next, z++) {
region * r = rl->region;
if (add_laen[z]>0) {
if (a_find(rl->region->attribs, &at_laen))
rsetlaen(rl->region, add_laen[z]+rlaen(rl->region));
}
else {
attrib *a=a_new(&at_laen);
struct message * msg = NULL;
a_add(&rl->region->attribs, a);
rsetlaen(rl->region, add_laen[z]);
/* Meldungen generieren */
for (u=r->units;u;u=u->next) freset(u->faction, FL_DH);
for (u = r->units; u; u = u->next ) {
if (!fval(u->faction, FL_DH) && eff_skill(u, SK_MINING, rl->region) >= olditemtype[I_LAEN]->minskill)
{
if (!msg) msg = msg_message("unveileog", "unit region", u, rl->region);
r_addmessage(rl->region, u->faction, msg);
fset(u->faction, FL_DH);
}
}
if (msg) msg_release(msg);
}
}
free(add_laen);
free_regionlist(Berge);
}
#endif

View File

@ -107,7 +107,7 @@ typedef struct building_list {
extern void free_buildinglist(building_list *bl); extern void free_buildinglist(building_list *bl);
extern void add_buildinglist(building_list **bl, struct building *b); extern void add_buildinglist(building_list **bl, struct building *b);
extern attrib_type at_building_generic_type; extern struct attrib_type at_building_generic_type;
extern const char * buildingtype(const struct building * b, int bsize); extern const char * buildingtype(const struct building * b, int bsize);
extern const char * buildingname(const struct building * b); extern const char * buildingname(const struct building * b);
extern int buildingmaintenance(const building * b, const struct resource_type * rtype); extern int buildingmaintenance(const building * b, const struct resource_type * rtype);

View File

@ -84,7 +84,6 @@
#include <errno.h> #include <errno.h>
/* exported variables */ /* exported variables */
const char *xmlfile = "eressea.xml";
region *regions; region *regions;
faction *factions; faction *factions;
settings global; settings global;
@ -107,6 +106,7 @@ static attrib_type at_creator = {
"creator" "creator"
/* Rest ist NULL; temporäres, nicht alterndes Attribut */ /* Rest ist NULL; temporäres, nicht alterndes Attribut */
}; };
static int static int
MaxAge(void) { MaxAge(void) {
static int value = -1; static int value = -1;
@ -397,7 +397,6 @@ allied_skilllimit(const faction * f, skill_t sk)
const char * str = get_param(global.parameters, "allied.skilllimit"); const char * str = get_param(global.parameters, "allied.skilllimit");
return str?atoi(str):0; return str?atoi(str):0;
} }
#endif #endif
int int
@ -481,7 +480,7 @@ int quiet = 0;
FILE *debug; FILE *debug;
int int
shipspeed (ship * sh, const unit * u) shipspeed (const ship * sh, const unit * u)
{ {
int k = sh->type->range; int k = sh->type->range;
static const curse_type * stormwind_ct, * nodrift_ct; static const curse_type * stormwind_ct, * nodrift_ct;
@ -3101,7 +3100,6 @@ kernel_init(void)
skill_init(); skill_init();
attrib_init(); attrib_init();
translation_init(); translation_init();
init_messages();
if (!turn) turn = lastturn(); if (!turn) turn = lastturn();
if (turn == 0) if (turn == 0)

View File

@ -20,6 +20,7 @@
#ifndef ERESSEA_H #ifndef ERESSEA_H
#define ERESSEA_H #define ERESSEA_H
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
@ -74,13 +75,14 @@ struct weapon_type;
struct ship_type; struct ship_type;
struct building_type; struct building_type;
#include <cvector.h> #include <util/attrib.h>
#include <umlaut.h> #include <util/cvector.h>
#include <language.h> #include <util/language.h>
#include <lists.h> #include <util/lists.h>
#include <vmap.h> #include <util/log.h>
#include <vset.h> #include <util/umlaut.h>
#include <attrib.h> #include <util/vmap.h>
#include <util/vset.h>
#define AT_PERSISTENT #define AT_PERSISTENT
#ifdef ALLIANCES #ifdef ALLIANCES
@ -257,7 +259,6 @@ extern void read_laen(struct region * r, int laen);
/* Zuwachs Eisen in Bergregionen */ /* Zuwachs Eisen in Bergregionen */
#define IRONPERTURN 25 #define IRONPERTURN 25
#define MAXLAENPERTURN 6 #define MAXLAENPERTURN 6
#define NEW_LAEN 0
/* Eisen in Gletschern */ /* Eisen in Gletschern */
#define GLIRONSTART 20 #define GLIRONSTART 20
/* Zuwachs Eisen in Gletschern */ /* Zuwachs Eisen in Gletschern */
@ -743,7 +744,8 @@ enum {
#define MAXSPEED 21 #define MAXSPEED 21
int shipspeed(struct ship * sh, const struct unit * u); extern int shipspeed(const struct ship * sh, const struct unit * u);
extern int init_data(const char * filename);
/* MAXSPEED setzt die groesse fuer den Array, der die Kuesten Beschreibungen /* MAXSPEED setzt die groesse fuer den Array, der die Kuesten Beschreibungen
* enthaelt. MAXSPEED muss 2x +3 so gross wie die groesste Geschw. sein * enthaelt. MAXSPEED muss 2x +3 so gross wie die groesste Geschw. sein
@ -886,7 +888,7 @@ typedef struct strlist {
#define freset(u, i) ((u)->flags &= ~(i)) #define freset(u, i) ((u)->flags &= ~(i))
extern int turn; extern int turn;
extern const char *xmlfile; extern int quiet;
/* parteinummern */ /* parteinummern */
extern int *used_faction_ids; extern int *used_faction_ids;
@ -1163,7 +1165,6 @@ typedef struct settings {
} settings; } settings;
extern settings global; extern settings global;
extern FILE * updatelog;
extern int produceexp(struct unit * u, skill_t sk, int n); extern int produceexp(struct unit * u, skill_t sk, int n);
extern boolean sqlpatch; extern boolean sqlpatch;

View File

@ -2340,169 +2340,6 @@ attrib_type at_resourcelimit = {
finalize_resourcelimit, finalize_resourcelimit,
}; };
#define DYNAMIC_TYPES
#ifdef DYNAMIC_TYPES
void
rt_write(FILE * F, const resource_type * rt)
{
fprintf(F, "RESOURCETYPE %d\n", rt->hashkey);
a_write(F, rt->attribs); /* scheisse, weil nicht CR. */
fputc('\n', F);
fprintf(F, "\"%s\";name_singular\n", rt->_name[0]);
fprintf(F, "\"%s\";name_plural\n", rt->_name[1]);
fprintf(F, "\"%s\";appearance_singular\n", rt->_appearance[0]);
fprintf(F, "\"%s\";appearance_plural\n", rt->_appearance[1]);
fprintf(F, "%d;flags\n", rt->flags);
if (rt->uchange) {
assert(rt->uchange==res_changeitem || !"not implemented");
fputs("\"res_changeitem\";uchange\n", F);
}
if (rt->uget!=NULL) assert(!"not implemented");
if (rt->name!=NULL) assert(!"not implemented");
fputs("END RESOURCETYPE\n", F);
}
void
it_write(FILE * F, const item_type * it)
/* Written at Gate E2 of Amsterdam Airport.
* If someone had installed power outlets there,
* I would have been able to test this stuff */
{
fprintf(F, "ITEMTYPE %s\n", it->rtype->_name[0]);
fprintf(F, "%d;flags\n", it->flags);
fprintf(F, "%d;weight\n", it->weight);
fprintf(F, "%d;capacity\n", it->capacity);
if (it->use!=NULL) {
const char * name = get_functionname((pf_generic)it->use);
fprintf(F, "\"%s\";use\n", name);
}
if (it->give!=NULL) {
const char * name = get_functionname((pf_generic)it->give);
fprintf(F, "\"%s\";give\n", name);
}
fputs("END ITEMTYPE\n", F);
}
resource_type *
rt_read(FILE * F)
/* this function is pretty picky */
{
resource_type * rt = calloc(sizeof(resource_type), 1);
unsigned int hash;
int i = fscanf(F, "%u\n", &hash);
if (i==0 || i==EOF) {
free(rt);
return NULL;
}
a_read(F, &rt->attribs); /* scheisse, weil nicht CR. */
for (;;) {
char * semi = buf;
char * s = NULL;
int i = 0;
fgets(buf, sizeof(buf), F);
if (strlen(buf)==1) continue;
buf[strlen(buf)-1]=0;
for(;;) {
char * s = strchr(semi, ';');
if (s==NULL) break;
semi = s + 1;
}
if (semi==buf) {
assert(!strcmp(buf, "END RESOURCETYPE"));
break;
}
*(semi-1)=0;
if (buf[0]=='\"') {
s = buf+1;
assert(*(semi-2)=='\"');
*(semi-2)=0;
}
else {
i = atoi(buf);
}
switch (semi[0]) {
case 'a':
if (!strcmp(semi, "appearance_singular")) rt->_appearance[0]=strdup(s);
if (!strcmp(semi, "appearance_plural")) rt->_appearance[1]=strdup(s);
break;
case 'f':
if (!strcmp(semi, "flags")) rt->flags=i;
break;
case 'n':
if (!strcmp(semi, "name_singular")) rt->_name[0]=strdup(s);
if (!strcmp(semi, "name_plural")) rt->_name[1]=strdup(s);
break;
case 'u':
if (!strcmp(semi, "uchange")) {
if (!strcmp(s, "res_changeitem")) rt->uchange = res_changeitem;
}
}
}
rt_register(rt);
return rt;
}
item_type *
it_read(FILE * F)
/* this function is pretty picky */
{
item_type * it = calloc(sizeof(item_type), 1);
int i = fscanf(F, "%s\n", buf);
if (i==0 || i==EOF) {
free(it);
return NULL;
}
it->rtype = rt_find(buf);
assert(it->rtype || !"resource does not exist");
for (;;) {
char * semi = buf;
char * s = NULL;
int i = 0;
fgets(buf, sizeof(buf), F);
if (strlen(buf)==1) continue;
buf[strlen(buf)-1]=0;
for(;;) {
char * s = strchr(semi, ';');
if (s==NULL) break;
semi = s + 1;
}
if (semi==buf) {
assert(!strcmp(buf, "END ITEMTYPE"));
break;
}
*(semi-1)=0;
if (buf[0]=='\"') {
s = buf+1;
assert(*(semi-2)=='\"');
*(semi-2)=0;
}
else {
i = atoi(buf);
}
switch (semi[0]) {
case 'c':
if (!strcmp(semi, "capacity")) it->capacity=i;
break;
case 'f':
if (!strcmp(semi, "flags")) it->flags=i;
break;
case 'g':
if (!strcmp(semi, "give")) it->give = (boolean (*)(const unit*, const unit*, const struct item_type *, int, const char *))get_function(s);
break;
case 'u':
if (!strcmp(semi, "use")) it->use = (int (*)(unit *, const struct item_type *, int, const char *))get_function(s);
break;
case 'w':
if (!strcmp(semi, "weight")) it->weight=i;
break;
}
}
it_register(it);
return it;
}
#endif
const char* const char*
resname(resource_t res, int index) resname(resource_t res, int index)
{ {

View File

@ -546,10 +546,6 @@ int res_changeitem(struct unit * u, const resource_type * rtype, int delta);
extern struct attrib_type at_showitem; /* show this potion's description */ extern struct attrib_type at_showitem; /* show this potion's description */
extern struct attrib_type at_seenitem; /* knows this potion's description, no need to reshow */ extern struct attrib_type at_seenitem; /* knows this potion's description, no need to reshow */
extern item_type * it_read(FILE * F);
extern resource_type * rt_read(FILE * F);
extern void it_write(FILE * F, const item_type * it);
extern void rt_write(FILE * F, const resource_type * rt);
extern void register_resources(void); extern void register_resources(void);
extern void init_resources(void); extern void init_resources(void);

View File

@ -499,7 +499,3 @@ read_msglevels(struct warning ** w, FILE * F)
} }
#endif #endif
void
init_messages(void)
{
}

View File

@ -59,7 +59,6 @@ extern struct message * msg_error(const struct unit *, const char *cmd,
const char * name, const char* sig, ...); const char * name, const char* sig, ...);
extern struct message * add_message(struct message_list** pm, struct message * m); extern struct message * add_message(struct message_list** pm, struct message * m);
extern void free_messages(struct message_list * m); extern void free_messages(struct message_list * m);
extern void init_messages(void);
/* message sections */ /* message sections */
extern struct messageclass * msgclasses; extern struct messageclass * msgclasses;

View File

@ -19,8 +19,6 @@
extern "C" { extern "C" {
#endif #endif
#include <stdio.h>
typedef struct obj_ID { typedef struct obj_ID {
int a, b; int a, b;
} obj_ID; } obj_ID;

View File

@ -35,7 +35,7 @@ extern "C" {
#define PFL_NOSTEALTH 256 /* Tarnung außer Betrieb */ #define PFL_NOSTEALTH 256 /* Tarnung außer Betrieb */
#define PFL_NOTEACH 512 /* Lehre außer Betrieb */ #define PFL_NOTEACH 512 /* Lehre außer Betrieb */
#define PFL_NOBUILD 1024 /* Bauen außer Betrieb */ #define PFL_NOBUILD 1024 /* Bauen außer Betrieb */
#define PFL_NOFEED 2048 /* Kein Unterhalt nötig TODO */ #define PFL_NOFEED 2048 /* Kein Unterhalt nötig */
#define PFL_FRIENDLY 4096 /* everyone is your ally */ #define PFL_FRIENDLY 4096 /* everyone is your ally */
#define PFL_NOORCGROWTH 8192 /* orcs don't grow */ #define PFL_NOORCGROWTH 8192 /* orcs don't grow */
#define PFL_NOMONSTERS 16384 /* no monster randenc */ #define PFL_NOMONSTERS 16384 /* no monster randenc */

View File

@ -167,6 +167,11 @@ render_cleanup(void)
} }
} }
static const char *
v_order(const locale * l, void * data) {
return (const char *)data;
}
static const char * static const char *
v_unit(const locale * l, void * data) { v_unit(const locale * l, void * data) {
unit * u = (void*)data; unit * u = (void*)data;
@ -498,6 +503,7 @@ render_init(void)
add_evalfun("dir", loc, v_dir); add_evalfun("dir", loc, v_dir);
add_evalfun("travel", loc, v_travel); add_evalfun("travel", loc, v_travel);
add_evalfun("unit", loc, v_unit); add_evalfun("unit", loc, v_unit);
add_evalfun("order", loc, v_order);
add_evalfun("of", loc, v_of_de); add_evalfun("of", loc, v_of_de);
add_evalfun("sink", loc, v_sink_de); add_evalfun("sink", loc, v_sink_de);
add_evalfun("mage", loc, v_mage_de); add_evalfun("mage", loc, v_mage_de);

File diff suppressed because it is too large Load Diff

View File

@ -46,13 +46,11 @@ extern boolean is_persistent(const char *s, const struct locale * lang);
/* Versionsänderungen: */ /* Versionsänderungen: */
#define HEX_VERSION 81 #define HEX_VERSION 81
extern int data_version; extern int data_version;
extern int minfaction;
extern int maxregions; extern int maxregions;
extern int firstx, firsty; extern int firstx, firsty;
extern int quiet; extern const char *xmlfile;
extern void init_locales(void); extern void init_locales(void);
extern int init_data(const char * xmlfile);
extern int lastturn(void); extern int lastturn(void);
extern void read_items(FILE *f, struct item **it); extern void read_items(FILE *f, struct item **it);

View File

@ -102,18 +102,18 @@ typedef struct unit_list {
extern void unitlist_clear(struct unit_list **ul); extern void unitlist_clear(struct unit_list **ul);
extern void unitlist_insert(struct unit_list **ul, struct unit *u); extern void unitlist_insert(struct unit_list **ul, struct unit *u);
extern attrib_type at_alias; extern struct attrib_type at_alias;
extern attrib_type at_siege; extern struct attrib_type at_siege;
extern attrib_type at_target; extern struct attrib_type at_target;
extern attrib_type at_potionuser; extern struct attrib_type at_potionuser;
extern attrib_type at_contact; extern struct attrib_type at_contact;
extern attrib_type at_effect; extern struct attrib_type at_effect;
extern attrib_type at_private; extern struct attrib_type at_private;
extern attrib_type at_showskchange; extern struct attrib_type at_showskchange;
int ualias(const struct unit * u); int ualias(const struct unit * u);
extern attrib_type at_stealth; extern struct attrib_type at_stealth;
void u_seteffstealth(struct unit * u, int value); void u_seteffstealth(struct unit * u, int value);
int u_geteffstealth(const struct unit * u); int u_geteffstealth(const struct unit * u);
@ -167,7 +167,7 @@ extern void destroy_unit(struct unit * u);
/* see resolve.h */ /* see resolve.h */
extern void * resolve_unit(void * data); extern void * resolve_unit(void * data);
extern void write_unit_reference(const unit * u, FILE * F); extern void write_unit_reference(const struct unit * u, FILE * F);
extern int read_unit_reference(unit ** up, FILE * F); extern int read_unit_reference(unit ** up, FILE * F);
extern void leave(struct region * r, struct unit * u); extern void leave(struct region * r, struct unit * u);

View File

@ -1012,10 +1012,9 @@ parse_main(xmlDocPtr doc)
for (i=0;i!=nodes->nodeNr;++i) { for (i=0;i!=nodes->nodeNr;++i) {
xmlNodePtr node = nodes->nodeTab[i]; xmlNodePtr node = nodes->nodeTab[i];
xmlChar * name = xmlGetProp(node, BAD_CAST "name"); xmlChar * name = xmlGetProp(node, BAD_CAST "name");
xmlChar * disable = xmlGetProp(node, BAD_CAST "disable"); boolean disable = xml_bvalue(node, "disable", false);
if (disable!=NULL) { if (disable) {
if (strcmp((const char*)disable, "yes")==0) {
int k; int k;
for (k=0;k!=MAXKEYWORDS;++k) { for (k=0;k!=MAXKEYWORDS;++k) {
if (strcmp(keywords[k], (const char*)name)==0) { if (strcmp(keywords[k], (const char*)name)==0) {
@ -1027,8 +1026,6 @@ parse_main(xmlDocPtr doc)
log_error(("trying to disable unknown comand %s\n", (const char*)name)); log_error(("trying to disable unknown comand %s\n", (const char*)name));
} }
} }
xmlFree(disable);
}
xmlFree(name); xmlFree(name);
} }
xmlXPathFreeObject(result); xmlXPathFreeObject(result);

View File

@ -18,8 +18,6 @@
extern "C" { extern "C" {
#endif #endif
#include <stdio.h>
typedef void (*afun)(void); typedef void (*afun)(void);
typedef struct attrib { typedef struct attrib {

View File

@ -18,7 +18,6 @@
extern "C" { extern "C" {
#endif #endif
#include <stdio.h>
#include "variant.h" #include "variant.h"
struct attrib; struct attrib;

View File

@ -93,3 +93,4 @@ chance(double x)
if (x>=1.0) return true; if (x>=1.0) return true;
return (boolean) (rand() % RAND_MAX < RAND_MAX * x); return (boolean) (rand() % RAND_MAX < RAND_MAX * x);
} }

View File

@ -25,8 +25,6 @@
extern "C" { extern "C" {
#endif #endif
#include <stdio.h>
extern FILE * sqlstream; extern FILE * sqlstream;
extern void sql_init(const char * filename); extern void sql_init(const char * filename);
extern void sql_done(void); extern void sql_done(void);

View File

@ -41,6 +41,7 @@ xml_bvalue(xmlNodePtr node, const char * name, boolean dflt)
xmlChar * property = xmlGetProp(node, BAD_CAST name); xmlChar * property = xmlGetProp(node, BAD_CAST name);
if (property!=NULL) { if (property!=NULL) {
if (strcmp((const char*)property, "yes")==0) result = true; if (strcmp((const char*)property, "yes")==0) result = true;
if (strcmp((const char*)property, "true")==0) result = true;
if (strcmp((const char*)property, "1")==0) { if (strcmp((const char*)property, "1")==0) {
log_warning(("boolean value is '1': %s::%s\n", node->name, name)); log_warning(("boolean value is '1': %s::%s\n", node->name, name));
result = true; result = true;

View File

@ -22,6 +22,15 @@
#ifndef CONFIG_H #ifndef CONFIG_H
#define CONFIG_H #define CONFIG_H
#ifdef __cplusplus
# include <cstdio>
# include <cstdlib>
extern "C" {
#else
# include <stdio.h>
# include <stdlib.h>
#endif
/**** **** /**** ****
** Debugging Libraries ** ** Debugging Libraries **
**** ****/ **** ****/
@ -92,7 +101,7 @@
# define __EXTENSIONS__ # define __EXTENSIONS__
#endif #endif
#ifdef _MSC_VER #ifdef WIN32
# include <common/util/windir.h> # include <common/util/windir.h>
# define HAVE_READDIR # define HAVE_READDIR
#endif #endif
@ -225,6 +234,9 @@ extern char * strdup(const char *s);
# define false ((boolean)0) # define false ((boolean)0)
# define true ((boolean)!false) # define true ((boolean)!false)
#endif #endif
#ifdef __cplusplus
}
#endif
/* this function must be implemented in a .o file */ /* this function must be implemented in a .o file */
extern char * strnzcpy(char * dst, const char *src, size_t len); extern char * strnzcpy(char * dst, const char *src, size_t len);

View File

@ -608,7 +608,6 @@ main(int argc, char *argv[])
char zText[MAX_PATH]; char zText[MAX_PATH];
sqlpatch = true; sqlpatch = true;
updatelog = fopen("update.log", "w");
log_open("eressea.log"); log_open("eressea.log");
printf("\n%s PBEM host\n" printf("\n%s PBEM host\n"
"Copyright (C) 1996-2001 C.Schlittchen, K.Zedel, E.Rehling, H.Peters.\n\n" "Copyright (C) 1996-2001 C.Schlittchen, K.Zedel, E.Rehling, H.Peters.\n\n"
@ -710,6 +709,5 @@ main(int argc, char *argv[])
#endif #endif
kernel_done(); kernel_done();
log_close(); log_close();
fclose(updatelog);
return 0; return 0;
} }

View File

@ -65,21 +65,21 @@
#include <kernel/building.h> #include <kernel/building.h>
#include <kernel/faction.h> #include <kernel/faction.h>
#include <kernel/item.h> #include <kernel/item.h>
#include <kernel/spell.h>
#include <kernel/message.h> #include <kernel/message.h>
#include <kernel/plane.h> #include <kernel/plane.h>
#include <kernel/race.h> #include <kernel/race.h>
#include <kernel/region.h> #include <kernel/region.h>
#include <kernel/region.h>
#include <kernel/reports.h> #include <kernel/reports.h>
#include <kernel/resources.h> #include <kernel/resources.h>
#include <kernel/save.h> #include <kernel/save.h>
#include <kernel/ship.h> #include <kernel/ship.h>
#include <kernel/skill.h> #include <kernel/skill.h>
#include <kernel/spell.h>
#include <kernel/teleport.h> #include <kernel/teleport.h>
#include <kernel/unit.h> #include <kernel/unit.h>
#include <kernel/xmlreader.h> #include <kernel/xmlreader.h>
/* util includes */ /* util includes */
#include <util/base36.h> #include <util/base36.h>
#include <util/goodies.h> #include <util/goodies.h>
@ -99,6 +99,7 @@
#include <cstring> #include <cstring>
#include <ctime> #include <ctime>
#include <clocale> #include <clocale>
/** /**
** global variables we are importing from other modules ** global variables we are importing from other modules
**/ **/
@ -626,10 +627,9 @@ main(int argc, char *argv[])
char zText[MAX_PATH]; char zText[MAX_PATH];
sqlpatch = true; sqlpatch = true;
updatelog = fopen("update.log", "w");
log_open("eressea.log"); log_open("eressea.log");
printf("\n%s PBEM host\n" printf("\n%s PBEM host\n"
"Copyright (C) 1996-2003 C. Schlittchen, K. Zedel, E. Rehling, H. Peters.\n\n" "Copyright (C) 1996-2004 C. Schlittchen, K. Zedel, E. Rehling, H. Peters.\n\n"
"Compilation: " __DATE__ " at " __TIME__ "\nVersion: %f\n\n", global.gamename, version()); "Compilation: " __DATE__ " at " __TIME__ "\nVersion: %f\n\n", global.gamename, version());
setlocale(LC_ALL, ""); setlocale(LC_ALL, "");
@ -663,6 +663,5 @@ main(int argc, char *argv[])
kernel_done(); kernel_done();
lua_done(luaState); lua_done(luaState);
log_close(); log_close();
fclose(updatelog);
return 0; return 0;
} }

View File

@ -2,7 +2,7 @@
+-------------------+ Christian Schlittchen <corwin@amber.kn-bremen.de> +-------------------+ Christian Schlittchen <corwin@amber.kn-bremen.de>
| | Enno Rehling <enno@eressea-pbem.de> | | Enno Rehling <enno@eressea-pbem.de>
| Eressea PBEM host | Katja Zedel <katze@felidae.kn-bremen.de> | Eressea PBEM host | Katja Zedel <katze@felidae.kn-bremen.de>
| (c) 1998 - 2003 | Henning Peters <faroul@beyond.kn-bremen.de> | (c) 1998 - 2004 | Henning Peters <faroul@beyond.kn-bremen.de>
| | Ingo Wilken <Ingo.Wilken@informatik.uni-oldenburg.de> | | Ingo Wilken <Ingo.Wilken@informatik.uni-oldenburg.de>
+-------------------+ Stefan Reich <reich@halbling.de> +-------------------+ Stefan Reich <reich@halbling.de>

View File

@ -1,25 +1,21 @@
<?xml version="1.0"?> <?xml version="1.0"?>
<buildings> <buildings>
<building name="xmas_exit" maxsize="10" maxcapacity="2" nobuild="yes" nodestroy="yes" unique="yes" auraregen="1.00"/>
<building name="caldera" capacity="1" nodestroy="yes" nobuild="yes" auraregen="1.00"/>
<building name="genericbuilding" maxsize="1" nobuild="yes" auraregen="1.00"/>
<building name="illusioncastle" capacity="0" maxcapacity="0" maxsize="0" nobuild="yes" auraregen="1.00"/> <building name="illusioncastle" capacity="0" maxcapacity="0" maxsize="0" nobuild="yes" auraregen="1.00"/>
<building name="xmas_exit" maxsize="10" maxcapacity="2" nobuild="yes" nodestroy="yes" unique="yes" auraregen="1.00"/>
<building name="caldera" capacity="1" nodestroy="yes" nobuild="yes" auraregen="1.00"/>
<building name="genericbuilding" maxsize="1" nobuild="yes" auraregen="1.00"/>
<building name="blessedstonecircle" maxsize="100" nobuild="yes" magic="yes" magres="60" magresbonus="30" auraregen="1.50"> <building name="blessedstonecircle" maxsize="100" nobuild="yes" magic="yes" magres="60" magresbonus="30" auraregen="1.50">
<construction skill="sk_building" minskill="2" reqsize="100" maxsize="100"> <construction skill="sk_building" minskill="2" reqsize="100" maxsize="100">
<requirement type="log" recycle="0.5" quantity="500"/> <requirement type="log" recycle="0.5" quantity="500"/>
<requirement type="stone" recycle="0.5" quantity="500"/> <requirement type="stone" recycle="0.5" quantity="500"/>
</construction></building> </construction>
</building>
<building name="stonecircle" maxsize="100" auraregen="1.00"> <building name="stonecircle" maxsize="100" auraregen="1.00">
<construction skill="sk_building" minskill="2" reqsize="100" maxsize="100"> <construction skill="sk_building" minskill="2" reqsize="100" maxsize="100">
<requirement type="log" recycle="0.5" quantity="500"/> <requirement type="log" recycle="0.5" quantity="500"/>
<requirement type="stone" recycle="0.5" quantity="500"/> <requirement type="stone" recycle="0.5" quantity="500"/>
</construction></building> </construction>
</building>
<building name="inn" capacity="1" auraregen="1.00"> <building name="inn" capacity="1" auraregen="1.00">
<maintenance type="money" amount="5" variable="yes" vital="yes"/> <maintenance type="money" amount="5" variable="yes" vital="yes"/>
<construction skill="sk_building" minskill="2" reqsize="10"> <construction skill="sk_building" minskill="2" reqsize="10">
@ -27,8 +23,8 @@
<requirement type="log" recycle="0.5" quantity="30"/> <requirement type="log" recycle="0.5" quantity="30"/>
<requirement type="stone" recycle="0.5" quantity="40"/> <requirement type="stone" recycle="0.5" quantity="40"/>
<requirement type="money" quantity="2000"/> <requirement type="money" quantity="2000"/>
</construction></building> </construction>
</building>
<building name="tunnel" capacity="1" maxsize="100" auraregen="1.00"> <building name="tunnel" capacity="1" maxsize="100" auraregen="1.00">
<maintenance type="stone" recycle="0.5" amount="2"/> <maintenance type="stone" recycle="0.5" amount="2"/>
<maintenance type="money" amount="100" vital="yes"/> <maintenance type="money" amount="100" vital="yes"/>
@ -37,8 +33,8 @@
<requirement type="log" recycle="0.5" quantity="500"/> <requirement type="log" recycle="0.5" quantity="500"/>
<requirement type="stone" recycle="0.5" quantity="1000"/> <requirement type="stone" recycle="0.5" quantity="1000"/>
<requirement type="money" quantity="30000"/> <requirement type="money" quantity="30000"/>
</construction></building> </construction>
</building>
<building name="caravan" capacity="1" maxsize="10" auraregen="1.00"> <building name="caravan" capacity="1" maxsize="10" auraregen="1.00">
<maintenance type="horse" amount="2"/> <maintenance type="horse" amount="2"/>
<maintenance type="money" amount="3000" vital="yes"/> <maintenance type="money" amount="3000" vital="yes"/>
@ -47,8 +43,8 @@
<requirement type="log" recycle="0.5" quantity="50"/> <requirement type="log" recycle="0.5" quantity="50"/>
<requirement type="stone" recycle="0.5" quantity="10"/> <requirement type="stone" recycle="0.5" quantity="10"/>
<requirement type="money" quantity="5000"/> <requirement type="money" quantity="5000"/>
</construction></building> </construction>
</building>
<building name="dam" capacity="1" maxsize="50" auraregen="1.00"> <building name="dam" capacity="1" maxsize="50" auraregen="1.00">
<maintenance type="log" recycle="0.5" amount="3"/> <maintenance type="log" recycle="0.5" amount="3"/>
<maintenance type="money" amount="1000" vital="yes"/> <maintenance type="money" amount="1000" vital="yes"/>
@ -57,16 +53,16 @@
<requirement type="log" recycle="0.5" quantity="500"/> <requirement type="log" recycle="0.5" quantity="500"/>
<requirement type="stone" recycle="0.5" quantity="250"/> <requirement type="stone" recycle="0.5" quantity="250"/>
<requirement type="money" quantity="25000"/> <requirement type="money" quantity="25000"/>
</construction></building> </construction>
</building>
<building name="monument" capacity="1" auraregen="1.00"> <building name="monument" capacity="1" auraregen="1.00">
<construction skill="sk_building" minskill="4" reqsize="1"> <construction skill="sk_building" minskill="4" reqsize="1">
<requirement type="log" recycle="0.5" quantity="1"/> <requirement type="log" recycle="0.5" quantity="1"/>
<requirement type="stone" recycle="0.5" quantity="1"/> <requirement type="stone" recycle="0.5" quantity="1"/>
<requirement type="iron" recycle="0.5" quantity="1"/> <requirement type="iron" recycle="0.5" quantity="1"/>
<requirement type="money" quantity="400"/> <requirement type="money" quantity="400"/>
</construction></building> </construction>
</building>
<building name="stables" capacity="1" auraregen="1.00"> <building name="stables" capacity="1" auraregen="1.00">
<maintenance type="money" amount="150" vital="yes"/> <maintenance type="money" amount="150" vital="yes"/>
<construction skill="sk_building" minskill="2" reqsize="1"> <construction skill="sk_building" minskill="2" reqsize="1">
@ -74,8 +70,8 @@
<requirement type="stone" recycle="0.5" quantity="2"/> <requirement type="stone" recycle="0.5" quantity="2"/>
<requirement type="iron" recycle="0.5" quantity="1"/> <requirement type="iron" recycle="0.5" quantity="1"/>
<requirement type="money" quantity="100"/> <requirement type="money" quantity="100"/>
</construction></building> </construction>
</building>
<building name="sawmill" capacity="1" auraregen="1.00"> <building name="sawmill" capacity="1" auraregen="1.00">
<maintenance type="money" amount="250" vital="yes"/> <maintenance type="money" amount="250" vital="yes"/>
<construction skill="sk_building" minskill="3" reqsize="1"> <construction skill="sk_building" minskill="3" reqsize="1">
@ -83,8 +79,8 @@
<requirement type="stone" recycle="0.5" quantity="5"/> <requirement type="stone" recycle="0.5" quantity="5"/>
<requirement type="iron" recycle="0.5" quantity="3"/> <requirement type="iron" recycle="0.5" quantity="3"/>
<requirement type="money" quantity="200"/> <requirement type="money" quantity="200"/>
</construction></building> </construction>
</building>
<building name="smithy" capacity="1" auraregen="1.00"> <building name="smithy" capacity="1" auraregen="1.00">
<function name="init" value="init_smithy"/> <function name="init" value="init_smithy"/>
<maintenance type="money" amount="300" vital="yes"/> <maintenance type="money" amount="300" vital="yes"/>
@ -94,8 +90,8 @@
<requirement type="stone" recycle="0.5" quantity="5"/> <requirement type="stone" recycle="0.5" quantity="5"/>
<requirement type="iron" recycle="0.5" quantity="2"/> <requirement type="iron" recycle="0.5" quantity="2"/>
<requirement type="money" quantity="200"/> <requirement type="money" quantity="200"/>
</construction></building> </construction>
</building>
<building name="magictower" maxcapacity="2" maxsize="50" magic="yes" magres="40" fumblebonus="10" auraregen="1.75"> <building name="magictower" maxcapacity="2" maxsize="50" magic="yes" magres="40" fumblebonus="10" auraregen="1.75">
<maintenance type="money" amount="1000" vital="yes"/> <maintenance type="money" amount="1000" vital="yes"/>
<construction skill="sk_building" minskill="5" reqsize="50" maxsize="50"> <construction skill="sk_building" minskill="5" reqsize="50" maxsize="50">
@ -105,8 +101,8 @@
<requirement type="iron" recycle="0.5" quantity="150"/> <requirement type="iron" recycle="0.5" quantity="150"/>
<requirement type="laen" quantity="100"/> <requirement type="laen" quantity="100"/>
<requirement type="money" quantity="25000"/> <requirement type="money" quantity="25000"/>
</construction></building> </construction>
</building>
<building name="academy" maxcapacity="25" maxsize="25" auraregen="1.00"> <building name="academy" maxcapacity="25" maxsize="25" auraregen="1.00">
<maintenance type="money" amount="1000" vital="yes"/> <maintenance type="money" amount="1000" vital="yes"/>
<construction skill="sk_building" minskill="3" reqsize="25" maxsize="25"> <construction skill="sk_building" minskill="3" reqsize="25" maxsize="25">
@ -114,16 +110,16 @@
<requirement type="stone" recycle="0.5" quantity="125"/> <requirement type="stone" recycle="0.5" quantity="125"/>
<requirement type="iron" recycle="0.5" quantity="25"/> <requirement type="iron" recycle="0.5" quantity="25"/>
<requirement type="money" quantity="12500"/> <requirement type="money" quantity="12500"/>
</construction></building> </construction>
</building>
<building name="harbour" capacity="1" maxcapacity="25" maxsize="25" auraregen="1.00"> <building name="harbour" capacity="1" maxcapacity="25" maxsize="25" auraregen="1.00">
<maintenance type="money" amount="250" vital="yes"/> <maintenance type="money" amount="250" vital="yes"/>
<construction skill="sk_building" minskill="3" reqsize="25" maxsize="25"> <construction skill="sk_building" minskill="3" reqsize="25" maxsize="25">
<requirement type="log" recycle="0.5" quantity="125"/> <requirement type="log" recycle="0.5" quantity="125"/>
<requirement type="stone" recycle="0.5" quantity="125"/> <requirement type="stone" recycle="0.5" quantity="125"/>
<requirement type="money" quantity="6250"/> <requirement type="money" quantity="6250"/>
</construction></building> </construction>
</building>
<building name="quarry" capacity="1" auraregen="1.00"> <building name="quarry" capacity="1" auraregen="1.00">
<maintenance type="money" amount="250" vital="yes"/> <maintenance type="money" amount="250" vital="yes"/>
<construction skill="sk_building" minskill="2" reqsize="1"> <construction skill="sk_building" minskill="2" reqsize="1">
@ -131,8 +127,8 @@
<requirement type="log" recycle="0.5" quantity="5"/> <requirement type="log" recycle="0.5" quantity="5"/>
<requirement type="stone" recycle="0.5" quantity="1"/> <requirement type="stone" recycle="0.5" quantity="1"/>
<requirement type="money" quantity="250"/> <requirement type="money" quantity="250"/>
</construction></building> </construction>
</building>
<building name="mine" capacity="1" auraregen="1.00"> <building name="mine" capacity="1" auraregen="1.00">
<maintenance type="money" amount="500" vital="yes"/> <maintenance type="money" amount="500" vital="yes"/>
<construction skill="sk_building" minskill="4" reqsize="1"> <construction skill="sk_building" minskill="4" reqsize="1">
@ -140,8 +136,8 @@
<requirement type="log" recycle="0.5" quantity="10"/> <requirement type="log" recycle="0.5" quantity="10"/>
<requirement type="stone" recycle="0.5" quantity="5"/> <requirement type="stone" recycle="0.5" quantity="5"/>
<requirement type="money" quantity="250"/> <requirement type="money" quantity="250"/>
</construction></building> </construction>
</building>
<building name="lighthouse" capacity="1" maxcapacity="4" auraregen="1.00"> <building name="lighthouse" capacity="1" maxcapacity="4" auraregen="1.00">
<maintenance type="money" amount="100" vital="yes"/> <maintenance type="money" amount="100" vital="yes"/>
<construction skill="sk_building" minskill="3" reqsize="1"> <construction skill="sk_building" minskill="3" reqsize="1">
@ -149,6 +145,7 @@
<requirement type="log" recycle="0.5" quantity="1"/> <requirement type="log" recycle="0.5" quantity="1"/>
<requirement type="stone" recycle="0.5" quantity="2"/> <requirement type="stone" recycle="0.5" quantity="2"/>
<requirement type="money" quantity="100"/> <requirement type="money" quantity="100"/>
</construction></building> </construction>
</building>
</buildings> </buildings>

View File

@ -5744,17 +5744,13 @@
</string> </string>
<string name="nr_calendar"> <string name="nr_calendar">
<text locale="de">Wir schreiben %s des Monats %s im Jahre %d %s. <text locale="de">Wir schreiben %s des Monats %s im Jahre %d %s.</text>
</text> <text locale="en">It is %s of the month of %s in the %d. year of %s.</text>
<text locale="en">It is %s of the month of %s in the %d. year of
%s.</text>
</string> </string>
<string name="nr_calendar_season"> <string name="nr_calendar_season">
<text locale="de">Wir schreiben %s des Monats %s im Jahre %d %s. <text locale="de">Wir schreiben %s des Monats %s im Jahre %d %s. Es ist %s.</text>
Es ist %s.</text> <text locale="en">It is %s of the month of %s in the %d. year of %s. It is %s.</text>
<text locale="en">It is %s of the month of %s in the %d. year of
%s. It is %s.</text>
</string> </string>
<string name="status_aggressive"> <string name="status_aggressive">

View File

@ -2,7 +2,7 @@
<eressea xmlns:xi="http://www.w3.org/2001/XInclude"> <eressea xmlns:xi="http://www.w3.org/2001/XInclude">
<xi:include href="messages.xml"/> <xi:include href="messages.xml"/>
<comment>Localization</comment> <!-- Localization -->
<xi:include href="de/strings.xml"/> <xi:include href="de/strings.xml"/>
<xi:include href="en/strings.xml"/> <xi:include href="en/strings.xml"/>
@ -10,6 +10,10 @@
<xi:include href="resources.xml"/> <xi:include href="resources.xml"/>
<xi:include href="ships.xml"/> <xi:include href="ships.xml"/>
<xi:include href="buildings.xml"/> <xi:include href="buildings.xml"/>
<xi:include file="terrains.xml"/>
<xi:include file="alchemy.xml"/>
<xi:include file="technologies.xml"/>
<xi:include file="skills.xml"/>
<game name="Eressea" welcome="eressea"> <game name="Eressea" welcome="eressea">
<comment>Game specific</comment> <comment>Game specific</comment>
@ -20,8 +24,8 @@
<param name="nmr.timeout" value="4"/> <param name="nmr.timeout" value="4"/>
<param name="nmr.removenewbie" value="1"/> <param name="nmr.removenewbie" value="1"/>
<param name="GiveRestriction" value="3"/> <param name="GiveRestriction" value="3"/>
<param name="database.gameid" value="0"/>
<param name="hunger.long" value="1"/> <param name="hunger.long" value="1"/>
<param name="database.gameid" value="0"/>
<param name="firstturn" value="184"/> <param name="firstturn" value="184"/>
</game> </game>
<xi:include href="eressea/de/strings.xml"/> <xi:include href="eressea/de/strings.xml"/>

File diff suppressed because it is too large Load Diff

View File

@ -19,10 +19,13 @@ function wyrm()
local map = {} local map = {}
local mapsize = 0 local mapsize = 0
local r local r
for r in regions() do for r in regions() do
if r.plane_id==plane then
mapsize=mapsize+1 mapsize=mapsize+1
map[mapsize] = r map[mapsize] = r
end end
end
local u local u
for u in grave.units do for u in grave.units do
@ -35,7 +38,7 @@ function wyrm()
local index local index
for index in map do for index in map do
local r = map[index] local r = map[index]
if r.x~=grave.x or r.y~=grave.y then if r~=grave then
if (math.mod(r.x,2)==math.mod(get_turn(),2)) then if (math.mod(r.x,2)==math.mod(get_turn(),2)) then
r:add_notice("Eine Botschaft von Igjarjuk, Herr der Wyrme: 'Die Zeit des Wartens ist beinahe vorrüber. Euer Fürst kehrt aus dem Grabe zurück.'") r:add_notice("Eine Botschaft von Igjarjuk, Herr der Wyrme: 'Die Zeit des Wartens ist beinahe vorrüber. Euer Fürst kehrt aus dem Grabe zurück.'")
else else