Hurra, der neue Source ist da und läuft.

This commit is contained in:
Enno Rehling 2001-01-28 08:01:52 +00:00
parent eac3772aa9
commit 6112847ae7
12 changed files with 68 additions and 30 deletions

View File

@ -133,6 +133,6 @@ $(BUILD_DIR)/%.o:: %.c
## and only for old datafiles.
##
CFLAGS += -DCONVERT_TRIGGER
INCLUDES += -I. -I$(ERESSEA)/eressea/old
#CFLAGS += -DCONVERT_TRIGGER
#INCLUDES += -I. -I$(ERESSEA)/eressea/old

19
src/common/Makefile Normal file
View File

@ -0,0 +1,19 @@
TARGETS = subdirs
SUBDIRS = \
util \
kernel \
gamecode \
triggers \
items \
attributes \
races \
spells \
modules \
eressea \
mapper
include ../Makefile.include
## more definitions

View File

@ -1,6 +1,6 @@
/* vi: set ts=2:
*
* $Id: border.c,v 1.2 2001/01/26 16:19:39 enno Exp $
* $Id: border.c,v 1.3 2001/01/28 08:01:51 enno Exp $
* Eressea PB(E)M host Copyright (C) 1998-2000
* Christian Schlittchen (corwin@amber.kn-bremen.de)
* Katja Zedel (katze@felidae.kn-bremen.de)
@ -76,10 +76,11 @@ write_borders(FILE * f)
putc('\n', f);
#if RELEASE_VERSION>BORDER_VERSION
a_write(f, b->attribs);
putc('\n', f);
#endif
}
}
fputs("end\n", f);
fputs("end", f);
}
void

View File

@ -1,6 +1,6 @@
/* vi: set ts=2:
*
* $Id: eressea.h,v 1.2 2001/01/26 16:19:39 enno Exp $
* $Id: eressea.h,v 1.3 2001/01/28 08:01:51 enno Exp $
* Eressea PB(E)M host Copyright (C) 1998-2000
* Christian Schlittchen (corwin@amber.kn-bremen.de)
* Katja Zedel (katze@felidae.kn-bremen.de)
@ -126,7 +126,8 @@ struct herb_type;
#define MAGE_ATTRIB_VERSION 195
#define GLOBAL_ATTRIB_VERSION 196
#define BASE36IDS_VERSION 197
#define LOCALE_VERSION 200 /* TODO */
#define NEWSOURCE_VERSION 197
#define LOCALE_VERSION 300 /* TODO */
/* globale settings des Spieles */
typedef struct settings {
@ -136,7 +137,7 @@ typedef struct settings {
} settings;
extern settings global;
#define RELEASE_VERSION BASE36IDS_VERSION
#define RELEASE_VERSION NEWSOURCE_VERSION
/* changes from->to: 72->73: struct unit::lock entfernt.
* 73->74: struct unit::flags eingeführt.

View File

@ -1,6 +1,6 @@
/* vi: set ts=2:
*
* $Id: item.c,v 1.3 2001/01/27 18:15:32 enno Exp $
* $Id: item.c,v 1.4 2001/01/28 08:01:51 enno Exp $
* Eressea PB(E)M host Copyright (C) 1998-2000
* Christian Schlittchen (corwin@amber.kn-bremen.de)
* Katja Zedel (katze@felidae.kn-bremen.de)
@ -1945,6 +1945,7 @@ 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]);

View File

@ -1,6 +1,6 @@
/* vi: set ts=2:
*
* $Id: magic.c,v 1.2 2001/01/26 16:19:39 enno Exp $
* $Id: magic.c,v 1.3 2001/01/28 08:01:51 enno Exp $
* Eressea PB(E)M host Copyright (C) 1998-2000
* Christian Schlittchen (corwin@amber.kn-bremen.de)
* Katja Zedel (katze@felidae.kn-bremen.de)
@ -2426,6 +2426,7 @@ set_familiar(unit * mage, unit * familiar)
attrib * a = a_add(&mage->attribs, a_new(&at_skillmod));
skillmod_data * smd = (skillmod_data *)a->data.v;
smd->special = sm_familiar;
assert(!nonplayer(mage));
}
a = a_find(mage->attribs, &at_familiar);
@ -2435,7 +2436,7 @@ set_familiar(unit * mage, unit * familiar)
} else assert(!a->data.v || a->data.v == familiar);
/* TODO: Diese Attribute beim Tod des Familiars entfernen: */
a = a_find(mage->attribs, &at_familiarmage);
a = a_find(familiar->attribs, &at_familiarmage);
if (a==NULL) {
a = a_add(&familiar->attribs, a_new(&at_familiarmage));
a->data.v = mage;

View File

@ -1,6 +1,6 @@
/* vi: set ts=2:
*
* $Id: region.c,v 1.2 2001/01/26 16:19:40 enno Exp $
* $Id: region.c,v 1.3 2001/01/28 08:01:52 enno Exp $
* Eressea PB(E)M host Copyright (C) 1998-2000
* Christian Schlittchen (corwin@amber.kn-bremen.de)
* Katja Zedel (katze@felidae.kn-bremen.de)
@ -36,6 +36,7 @@
/* libc includes */
#include <assert.h>
#include <ctype.h>
#include <limits.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@ -656,7 +657,7 @@ makename(void)
int s, v, k, e, p = 0, x = 0;
int nk, ne, nv, ns;
static char name[16];
char *kons = "bdfghklmnprstvwz",
const char *kons = "bdfghklmnprstvwz",
*end = "nlrdst",
*vokal = "aaaaaaaaaßàâeeeeeeeeeéèêiiiiiiiiiíîoooooooooóòôuuuuuuuuuúyy",
*start = "dgtskpvfr";
@ -801,14 +802,18 @@ read_region_reference(region ** r, FILE * F)
{
int x[2];
fscanf(F, "%d %d", &x[0], &x[1]);
*r = findregion(x[0], x[1]);
if (*r==NULL) ur_add(memcpy(malloc(sizeof(x)), x, sizeof(x)), (void**)r, resolve_region);
if (x[0]==INT_MAX) *r = NULL;
else {
*r = findregion(x[0], x[1]);
if (*r==NULL) ur_add(memcpy(malloc(sizeof(x)), x, sizeof(x)), (void**)r, resolve_region);
}
}
void
write_region_reference(const region * r, FILE * F)
{
fprintf(F, "%d %d ", r->x, r->y);
if (r) fprintf(F, "%d %d ", r->x, r->y);
else fprintf(F, "%d %d ", INT_MAX, INT_MAX);
}
void *

View File

@ -1,6 +1,6 @@
/* vi: set ts=2:
*
* $Id: save.c,v 1.4 2001/01/27 19:30:07 enno Exp $
* $Id: save.c,v 1.5 2001/01/28 08:01:52 enno Exp $
* Eressea PB(E)M host Copyright (C) 1998-2000
* Christian Schlittchen (corwin@amber.kn-bremen.de)
* Katja Zedel (katze@felidae.kn-bremen.de)
@ -740,6 +740,11 @@ readgame(boolean backup)
/* globale Variablen */
global.data_version = ri(F);
#ifdef CONVERT_TRIGGER
assert(global.data_version < NEWSOURCE_VERSION);
#else
assert(global.data_version >= NEWSOURCE_VERSION);
#endif
if (global.data_version >= GLOBAL_ATTRIB_VERSION) a_read(F, &global.attribs);
#ifndef COMPATIBILITY
if (global.data_version < ITEMTYPE_VERSION) {
@ -971,7 +976,7 @@ readgame(boolean backup)
if (maxregions==0) skip = true;
if ((n%1024)==0) { /* das spart extrem Zeit */
printf("* %d,%d \r", x, y);
printf(" - Einzulesende Regionen: %d/%d\t", maxregions, n);
printf(" - Einzulesende Regionen: %d/%d ", maxregions, n);
}
if (skip) {
char * r;
@ -1575,9 +1580,9 @@ writegame(char *path, char quiet)
/* Write planes */
wnl(F);
wi(F, listlen(planes));
wnl(F);
for(pl = planes; pl; pl=pl->next) {
wnl(F);
wi(F, pl->id);
wspace(F);
ws(F, pl->name);
@ -1593,9 +1598,9 @@ writegame(char *path, char quiet)
wi(F, pl->flags);
wspace(F);
a_write(F, pl->attribs);
wnl(F);
}
wnl(F);
/* Write factions */
@ -1638,6 +1643,7 @@ writegame(char *path, char quiet)
wi(F, f->flags);
wspace(F);
a_write(F, f->attribs);
wnl(F);
write_msglevels(f->warnings, F);
wnl(F);
wi(F, listlen(f->ursprung));
@ -1757,7 +1763,7 @@ writegame(char *path, char quiet)
wnl(F);
}
a_write(F, r->attribs);
wnl(F);
wi(F, listlen(r->buildings));
wnl(F);
for (b = r->buildings; b; b = b->next) {
@ -1782,6 +1788,7 @@ writegame(char *path, char quiet)
ws(F, b->type->_name);
wnl(F);
a_write(F, b->attribs);
wnl(F);
}
wi(F, listlen(r->ships));
@ -1812,6 +1819,7 @@ writegame(char *path, char quiet)
wi(F, sh->coast);
wnl(F);
a_write(F, sh->attribs);
wnl(F);
}
wi(F, listlen(r->units));
@ -1934,10 +1942,12 @@ writegame(char *path, char quiet)
wnl(F);
#endif
a_write(F, u->attribs);
wnl(F);
}
}
wnl(F);
write_borders(F);
wnl(F);
#ifdef OLD_TRIGGER
save_timeouts(F);
#endif

View File

@ -1,6 +1,6 @@
/* vi: set ts=2:
*
* $Id: xmas2000.c,v 1.1 2001/01/27 11:32:32 enno Exp $
* $Id: xmas2000.c,v 1.2 2001/01/28 08:01:52 enno Exp $
* Eressea PB(E)M host Copyright (C) 1998-2000
* Christian Schlittchen (corwin@amber.kn-bremen.de)
* Katja Zedel (katze@felidae.kn-bremen.de)
@ -132,8 +132,8 @@ make_gates(region * r)
b = new_building(btype, r, NULL);
b->size = btype->maxsize;
b->name = "Der Weg nach Hause";
b->display = "Achtung, hier gibt es die Geschenke!";
b->name = strdup("Der Weg nach Hause");
b->display = strdup("Achtung, hier gibt es die Geschenke!");
add_trigger(&b->attribs, "timer", trigger_xmasgate(b));
}

View File

@ -15,9 +15,9 @@ OBJECTS = $(SOURCES:%.c=$(BUILD_DIR)/%.o)
## conversion code for old triggers - should only be used for free eressea,
## and only for old datafiles.
##
SUBDIRS += old
LIBRARIES += $(PUBLISH_DIR)/libe-compat.a
LIBS += -le-compat
#SUBDIRS += old
#LIBRARIES += $(PUBLISH_DIR)/libe-compat.a
#LIBS += -le-compat
##
## more definitions

View File

@ -1,6 +1,6 @@
/* vi: set ts=2:
*
* $Id: korrektur.c,v 1.4 2001/01/27 19:30:07 enno Exp $
* $Id: korrektur.c,v 1.5 2001/01/28 08:01:52 enno Exp $
* Eressea PB(E)M host Copyright (C) 1998-2000
* Christian Schlittchen (corwin@amber.kn-bremen.de)
* Katja Zedel (katze@felidae.kn-bremen.de)
@ -1649,7 +1649,7 @@ convert_triggers(void)
switch (rel->id) {
case REL_FAMILIAR:
if (u && u2) {
if (nonplayer(u) || u->race==RC_GOBLIN)
if (nonplayer(u) || (!nonplayer(u2) && u->race==RC_GOBLIN))
set_familiar(u2, u);
else
set_familiar(u, u2);

View File

@ -1,6 +1,6 @@
/* vi: set ts=2:
*
* $Id: main.c,v 1.2 2001/01/26 16:19:41 enno Exp $
* $Id: main.c,v 1.3 2001/01/28 08:01:52 enno Exp $
* Eressea PB(E)M host Copyright (C) 1998-2000
* Christian Schlittchen (corwin@amber.kn-bremen.de)
* Katja Zedel (katze@felidae.kn-bremen.de)
@ -243,7 +243,7 @@ processturn(char *filename)
#endif /* FUZZY_BASE36 */
if (!nowrite) {
char ztext[64];
sprintf(ztext, "data/%d", turn);
sprintf(ztext, "%s/%d", datapath(), turn);
writegame(ztext, 0);
}
}