Updates aus aktueller Version in Dev-Version

This commit is contained in:
Enno Rehling 2001-04-08 17:36:50 +00:00
parent 46a4ef6585
commit b5778f1cfd
11 changed files with 83 additions and 38 deletions

View File

@ -25,6 +25,9 @@ LDFLAGS = $(LIBS)
LIBS = -L$(PUBLISH_DIR)
LINTFLAGS = -booltype boolean -boolops +posixlib +matchanyintegral \
-predboolint -retvalint -retvalother -realcompare -exportlocal
ARCHITECTURE = Linux
##
@ -91,6 +94,14 @@ ifeq ($(CONFIG), dmalloc)
LIBS += -ldmalloc
endif
# ifeq ($(CONFIG), lint)
# BUILD_DIR = Lint-$(ARCHITECTURE)
# CC = lint
# CFLAGS = -I$(ERESSEA) $(INCLUDES) -booltype boolean -boolops
# LDFLAGS =
# LIBS =
# endif
#
## Dependencies
@ -130,10 +141,11 @@ recurse-subdirs-release:: subdirs-release publish-release
recurse-subdirs-profile:: subdirs-profile publish-profile
recurse-subdirs-dmalloc:: subdirs-dmalloc publish-dmalloc
recurse-lint:: lint
recurse-clean:: clean
recurse-depend:: depend
subdirs-debug subdirs-release subdirs-profile subdirs-dmalloc clean depend::
subdirs-debug subdirs-release subdirs-profile subdirs-dmalloc lint clean depend::
@mkdir -p $(PUBLISH_DIR)
@if [ -n "$(SUBDIRS)" ]; then \
for subdir in x-placeholder-dir $(SUBDIRS); do \
@ -153,7 +165,10 @@ publish-dmalloc:: subdirs-dmalloc
publish-debug publish-release publish-profile publish-dmalloc:: $(PUBLISH_DIR)/$(LIBRARY) $(PUBLISH_DIR)/$(BINARY)
clean:: $(BUILD_DIR) $(PUBLISH_DIR)
rm -fr Release-$(ARCHITECTURE)/* Debug-$(ARCHITECTURE)/* Profile-$(ARCHITECTURE)/* Dmalloc-$(ARCHITECTURE)/*
rm -fr Release-$(ARCHITECTURE)/* Debug-$(ARCHITECTURE)/* Profile-$(ARCHITECTURE)/* Dmalloc-$(ARCHITECTURE)/* Lint-$(ARCHITECTURE)/*
lint::
$(LINT) -I$(ERESSEA) $(INCLUDES) $(LINTFLAGS) *.c
$(BUILD_DIR) $(PUBLISH_DIR):
@mkdir $@
@ -174,3 +189,4 @@ ifeq ($(CONVERT_TRIGGERS), 1)
CFLAGS += -DCONVERT_TRIGGER
INCLUDES += -I. -I$(ERESSEA)/eressea/old
endif

View File

@ -364,7 +364,7 @@ live(region * r)
void
calculate_emigration(region *r)
{
direction_t i;
direction_t i, j;
int maxpeasants_here;
int maxpeasants[MAXDIRECTIONS];
double wfactor, gfactor;
@ -387,6 +387,7 @@ calculate_emigration(region *r)
if (fval(r, RF_ORCIFIED)==fval(c, RF_ORCIFIED)) {
if (landregion(rterrain(c)) && landregion(rterrain(r))) {
int wandering_peasants;
double vfactor;
/* First let's calculate the peasants who wander off to less inhabited
* regions. wfactor indicates the difference of population denity.
@ -405,8 +406,25 @@ calculate_emigration(region *r)
gfactor = max(gfactor, 0);
gfactor = min(gfactor, 1);
/* This calculates the influence of volcanos on peasant
* migration. */
if(rterrain(c) != T_VOLCANO) {
vfactor = 0.25;
} else {
vfactor = 1.00;
}
for(j=0; j != MAXDIRECTIONS; j++) {
region *rv = rconnect(c, j);
if(rv && rterrain(rv) == T_VOLCANO) {
vfactor *= 0.5;
break;
}
}
wandering_peasants = (int) (rpeasants(r) * (gfactor + wfactor)
* PEASANTSWANDER_WEIGHT / 100.0);
* vfactor * PEASANTSWANDER_WEIGHT / 100.0);
r->land->newpeasants -= wandering_peasants;
c->land->newpeasants += wandering_peasants;

View File

@ -1715,7 +1715,7 @@ report(FILE *F, faction * f)
dh = 0;
for(a=a_find(f->attribs, &at_faction_special); a; a=a->nexttype) {
dh++;
if(fspecials[a->data.sa[0]].maxlevel) {
if(fspecials[a->data.sa[0]].maxlevel != 100) {
sprintf(buf2, "%s (%d)", fspecials[a->data.sa[0]].name, a->data.sa[1]);
} else {
sprintf(buf2, "%s", fspecials[a->data.sa[0]].name);

View File

@ -602,7 +602,8 @@ build(unit * u, const construction * ctype, int completed, int want)
while (type->improvement!=NULL &&
type->improvement!=type &&
type->maxsize>0 &&
type->maxsize<=completed) {
type->maxsize<=completed)
{
completed -= type->maxsize;
type = type->improvement;
}
@ -763,9 +764,17 @@ build_building(unit * u, const building_type * btype, int want)
if (b) built = b->size;
if (want<=0 || want == INT_MAX) {
if(b == NULL) {
want = btype->maxsize - built;
if(btype->maxsize > 0) {
want = btype->maxsize - built;
} else {
want = INT_MAX;
}
} else {
want = b->type->maxsize - built;
if(b->type->maxsize > 0) {
want = b->type->maxsize - built;
} else {
want = INT_MAX;
}
}
}
built = build(u, btype->construction, built, want);

View File

@ -1,6 +1,5 @@
/* vi: set ts=2:
*
* $Id: magic.c,v 1.12 2001/03/07 15:00:18 corwin Exp $
* Eressea PB(E)M host Copyright (C) 1998-2000
* Christian Schlittchen (corwin@amber.kn-bremen.de)
* Katja Zedel (katze@felidae.kn-bremen.de)
@ -1480,7 +1479,7 @@ regeneration_magiepunkte(void)
if (aura < auramax) {
struct building * b = inside_building(u);
const struct building_type * btype = b?b->type:NULL;
reg_aura = regeneration(u);
reg_aura = (double)regeneration(u);
/* Magierturm erhöht die Regeneration um 50% */
if (btype == &bt_magictower) {

View File

@ -1,5 +1,6 @@
/* vi: set ts=2:
*
* $Id: movement.c,v 1.17 2001/04/08 17:36:48 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)
@ -2125,6 +2126,8 @@ follow(void)
unit * uf = findunit(id);
if (!a) {
a = a_add(&u->attribs, make_follow(uf));
} else {
a->data.v = uf;
}
} else if (a) {
a_remove(&u->attribs, a);

View File

@ -1,5 +1,6 @@
/* vi: set ts=2:
*
* $Id: spell.c,v 1.17 2001/04/08 17:36:48 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)
@ -3554,7 +3555,7 @@ sp_bloodsacrifice(castorder *co)
return 0;
}
get_mage(mage)->spellpoints += aura;
change_spellpoints(mage, aura);
use_pooled(mage, mage->region, R_HITPOINTS, damage);
add_message(&mage->faction->msgs, new_message(mage->faction,

View File

@ -1023,7 +1023,7 @@ show_newspells(void)
* terminieren */
spellid_t newspellids[] = {
};
SPL_NOSPELL };
/* die id's der neuen oder veränderten Sprüche werden in newspellids[]
* abgelegt */
@ -1596,32 +1596,36 @@ stats(void)
static void
fix_prices(void)
{
FILE *fp;
char buf[256];
char *token;
int x, y, p, i;
region *r;
puts(" - Korrigiere Handelsgüterpreise");
fp = fopen("prices.fix", "r");
if (fp==NULL) return;
while(fgets(buf, 256, fp)!=NULL) {
token = strtok(buf, ":"); /* Name */
token = strtok(NULL, ":"); x = atoi(token);
token = strtok(NULL, ":"); y = atoi(token);
r = findregion(x, y);
assert(r != NULL);
if(r->land) {
for(i = 0; oldluxurytype[i]!=NULL; i++) {
token = strtok(NULL, ":"); p = atoi(token);
r_setdemand(r, oldluxurytype[i], p);
for(r=regions; r; r=r->next) if(r->land) {
int sales = 0, buys = 0;
const luxury_type *sale, *ltype;
struct demand *dmd;
for (dmd=r->land->demands;dmd;dmd=dmd->next) {
if(dmd->value == 0) {
sales++;
sale = dmd->type;
} else {
buys++;
}
}
if(sales == 0) {
int c = 0;
for(ltype=luxurytypes; ltype; ltype=ltype->next) c++;
c = rand()%c;
for(ltype=luxurytypes; c>0; c--) ltype=ltype->next;
r_setdemand(r, ltype, 0);
sale = ltype;
}
if(buys == 0) {
for(ltype=luxurytypes; ltype; ltype=ltype->next) {
if(ltype != sale) r_setdemand(r, ltype, 1 + rand() % 5);
}
}
}
fclose(fp);
}
static void
@ -2171,6 +2175,7 @@ korrektur(void)
do_once(atoi36("fhrb"), fix_herbs());
do_once(atoi36("ftos"), fix_timeouts());
do_once(atoi36("gmtst"), test_gmquest()); /* test gm quests */
do_once(atoi36("fixsl"), fix_prices());
#ifndef SKILLFIX_SAVE
fix_skills();
#endif

View File

@ -1,6 +1,5 @@
/* vi: set ts=2:
*
* $Id: map_modify.c,v 1.8 2001/04/01 06:58:44 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)
@ -1143,10 +1142,7 @@ settg(region *r)
if (tradegood==NULL) tradegood = luxurytypes;
for (ltype=luxurytypes; ltype; ltype=ltype->next) {
struct demand * dmd;
dmd = calloc(sizeof(struct demand), 1);
dmd->type = ltype;
if (ltype!=tradegood) dmd->value = 1 + rand() % 5;
if (ltype!=tradegood) r_setdemand(r, ltype, 1 + rand() % 5);
++g;
}
r_setdemand(r, tradegood, 0);

View File

@ -1,6 +1,5 @@
/* vi: set ts=2:
*
* $Id: mapper.c,v 1.14 2001/04/01 06:58:44 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)

View File

@ -1,6 +1,5 @@
/* vi: set ts=2:
*
* $Id: mapper.h,v 1.5 2001/04/01 06:58:44 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)