diff --git a/src/common/attributes/reduceproduction.c b/src/common/attributes/reduceproduction.c index 1783418f7..dec2c5aa5 100644 --- a/src/common/attributes/reduceproduction.c +++ b/src/common/attributes/reduceproduction.c @@ -20,7 +20,10 @@ static int age_reduceproduction(attrib *a) { - return --a->data.sa[1]; + int reduce = 100 - (5 * --a->data.sa[1]); + if (reduce < 10) reduce = 10; + a->data.sa[0] = (short)reduce; + return a->data.sa[1]; } attrib_type at_reduceproduction = { @@ -37,7 +40,9 @@ attrib * make_reduceproduction(int percent, int time) { attrib * a = a_new(&at_reduceproduction); - a->data.sa[0] = (short)percent; + int reduce = 100 - (5 * time); + if (reduce < 10) reduce = 10; + a->data.sa[0] = (short)reduce; a->data.sa[1] = (short)time; return a; } diff --git a/src/common/gamecode/randenc.c b/src/common/gamecode/randenc.c index a4d9467bb..006bbf7ec 100644 --- a/src/common/gamecode/randenc.c +++ b/src/common/gamecode/randenc.c @@ -1291,9 +1291,11 @@ randomevents(void) } /* Vulkane qualmen, brechen aus ... */ - for (r = regions; r; r = r->next) { - switch(rterrain(r)) { + if (rterrain(r)==T_VOLCANO_SMOKING && a_find(&r->attribs, &at_reduceproduction)) { + ADDMSG(&r->msgs, msg_message("volcanostopsmoke", "region", r)); + rsetterrain(r, T_VOLCANO); + } else switch(rterrain(r)) { case T_VOLCANO: if (rand()%100 < 4) { ADDMSG(&r->msgs, msg_message("volcanostartsmoke", "region", r)); diff --git a/src/common/kernel/eressea.c b/src/common/kernel/eressea.c index 93486e78f..2ddeec0f5 100644 --- a/src/common/kernel/eressea.c +++ b/src/common/kernel/eressea.c @@ -83,6 +83,7 @@ char buf[BUFSIZE + 1]; FILE *logfile; FILE *updatelog; const struct race * new_race[MAXRACES]; +boolean sqlpatch = false; race_t old_race(const struct race * rc) @@ -2055,7 +2056,7 @@ kernel_done(void) translation_done(); skill_done(); gc_done(); - sql_done(); + if (sqlstream!=NULL) sql_done(); } static void @@ -2311,9 +2312,10 @@ kernel_init(void) srand(time((time_t *) NULL)); else srand(turn); - - sprintf(zBuffer, "%s/patch-%d.sql", datapath(), turn); - sql_init(zBuffer); + if (sqlpatch) { + sprintf(zBuffer, "%s/patch-%d.sql", datapath(), turn); + sql_init(zBuffer); + } } /*********************/ diff --git a/src/common/kernel/eressea.h b/src/common/kernel/eressea.h index aefd5994b..fe2600bc6 100644 --- a/src/common/kernel/eressea.h +++ b/src/common/kernel/eressea.h @@ -1206,4 +1206,5 @@ extern settings global; extern FILE * updatelog; extern int produceexp(struct unit * u, skill_t sk, int n); +extern boolean sqlpatch; #endif diff --git a/src/eressea/main.c b/src/eressea/main.c index 2f480b192..af1fb4de0 100644 --- a/src/eressea/main.c +++ b/src/eressea/main.c @@ -593,6 +593,7 @@ main(int argc, char *argv[]) int i; char zText[MAX_PATH]; + sqlpatch = true; updatelog = fopen("update.log", "w"); log_open("eressea.log"); printf("\n%s PBEM host\n" diff --git a/src/mapper/mapper.c b/src/mapper/mapper.c index 262a76822..42b2542a6 100644 --- a/src/mapper/mapper.c +++ b/src/mapper/mapper.c @@ -1522,6 +1522,7 @@ main(int argc, char *argv[]) boolean readlog = false; boolean autoseeding = false; + sqlpatch = false; setlocale(LC_ALL, ""); fprintf(stderr, " \n Mapper V" VERSION " Hex (" __DATE__ ")\n\n"