forked from github/server
"ALLES funktioniert nicht bei GIB" - disabling OPTION MATERIALPOOL
This commit is contained in:
parent
321723f69f
commit
40898eea55
8 changed files with 38 additions and 51 deletions
|
@ -1230,7 +1230,12 @@ report_computer(const char * filename, report_context * ctx, const char * charse
|
||||||
print_items(F, f->items, f->locale);
|
print_items(F, f->items, f->locale);
|
||||||
fputs("OPTIONEN\n", F);
|
fputs("OPTIONEN\n", F);
|
||||||
for (i=0;i!=MAXOPTIONS;++i) {
|
for (i=0;i!=MAXOPTIONS;++i) {
|
||||||
fprintf(F, "%d;%s\n", (f->options&want(i))?1:0, options[i]);
|
int flag = want(i);
|
||||||
|
if (options[i]) {
|
||||||
|
fprintf(F, "%d;%s\n", (f->options&flag)?1:0, options[i]);
|
||||||
|
} else if (f->options&flag) {
|
||||||
|
f->options &= (~flag);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#ifdef ENEMIES
|
#ifdef ENEMIES
|
||||||
show_enemies(F, f->enemies);
|
show_enemies(F, f->enemies);
|
||||||
|
|
|
@ -3767,8 +3767,12 @@ static void maintain_buildings_2(region * r) { maintain_buildings(r,true); }
|
||||||
static void reset_moved(unit * u) { freset(u, UFL_MOVED); }
|
static void reset_moved(unit * u) { freset(u, UFL_MOVED); }
|
||||||
|
|
||||||
static void reset_rng(void) {
|
static void reset_rng(void) {
|
||||||
if (turn == 0) rng_init((int)time(0));
|
rng_init(turn?turn:(int)time(0));
|
||||||
else rng_init(turn);
|
}
|
||||||
|
|
||||||
|
static void reset_rng_region(const region * r)
|
||||||
|
{
|
||||||
|
rng_init(r->index);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** warn about passwords that are not US ASCII.
|
/** warn about passwords that are not US ASCII.
|
||||||
|
@ -3895,6 +3899,7 @@ processorders (void)
|
||||||
add_proc_order(p, K_TEACH, &teach_cmd, PROC_THISORDER|PROC_LONGORDER, "Lehren");
|
add_proc_order(p, K_TEACH, &teach_cmd, PROC_THISORDER|PROC_LONGORDER, "Lehren");
|
||||||
}
|
}
|
||||||
p+=10;
|
p+=10;
|
||||||
|
add_proc_region(p, &reset_rng_region, NULL);
|
||||||
add_proc_order(p, K_STUDY, &learn_cmd, PROC_THISORDER|PROC_LONGORDER, "Lernen");
|
add_proc_order(p, K_STUDY, &learn_cmd, PROC_THISORDER|PROC_LONGORDER, "Lernen");
|
||||||
|
|
||||||
p+=10;
|
p+=10;
|
||||||
|
|
|
@ -1373,8 +1373,7 @@ report_template(const char * filename, report_context * ctx, const char * charse
|
||||||
|
|
||||||
rps_nowrap(F, "");
|
rps_nowrap(F, "");
|
||||||
rnl(F);
|
rnl(F);
|
||||||
sprintf(buf, "; ECHECK %s-w4 -r%d -v%s", (f->options & want(O_SILBERPOOL)) ? "-l " : "",
|
sprintf(buf, "; ECHECK -l -w4 -r%d -v%s", f->race->recruitcost, ECHECK_VERSION);
|
||||||
f->race->recruitcost, ECHECK_VERSION);
|
|
||||||
/* -v3.4: ECheck Version 3.4.x */
|
/* -v3.4: ECheck Version 3.4.x */
|
||||||
rps_nowrap(F, buf);
|
rps_nowrap(F, buf);
|
||||||
rnl(F);
|
rnl(F);
|
||||||
|
@ -2056,7 +2055,7 @@ report_plaintext(const char * filename, report_context * ctx, const char * chars
|
||||||
bytes = snprintf(buf, size,"%s:", LOC(f->locale, "nr_options"));
|
bytes = snprintf(buf, size,"%s:", LOC(f->locale, "nr_options"));
|
||||||
if (wrptr(&bufp, &size, bytes)!=0) WARN_STATIC_BUFFER();
|
if (wrptr(&bufp, &size, bytes)!=0) WARN_STATIC_BUFFER();
|
||||||
for (op = 0; op != MAXOPTIONS; op++) {
|
for (op = 0; op != MAXOPTIONS; op++) {
|
||||||
if (f->options & want(op)) {
|
if (f->options & want(op) && options[op]) {
|
||||||
bytes = (int)strlcpy(bufp, " ", size);
|
bytes = (int)strlcpy(bufp, " ", size);
|
||||||
if (wrptr(&bufp, &size, bytes)!=0) WARN_STATIC_BUFFER();
|
if (wrptr(&bufp, &size, bytes)!=0) WARN_STATIC_BUFFER();
|
||||||
bytes = (int)strlcpy(bufp, LOC(f->locale, options[op]), size);
|
bytes = (int)strlcpy(bufp, LOC(f->locale, options[op]), size);
|
||||||
|
|
|
@ -433,12 +433,12 @@ const char *options[MAXOPTIONS] =
|
||||||
"AUSWERTUNG",
|
"AUSWERTUNG",
|
||||||
"COMPUTER",
|
"COMPUTER",
|
||||||
"ZUGVORLAGE",
|
"ZUGVORLAGE",
|
||||||
"SILBERPOOL",
|
NULL,
|
||||||
"STATISTIK",
|
"STATISTIK",
|
||||||
"DEBUG",
|
"DEBUG",
|
||||||
"ZIPPED",
|
"ZIPPED",
|
||||||
"ZEITUNG", /* Option hat Sonderbehandlung! */
|
"ZEITUNG", /* Option hat Sonderbehandlung! */
|
||||||
"MATERIALPOOL",
|
NULL,
|
||||||
"ADRESSEN",
|
"ADRESSEN",
|
||||||
"BZIP2",
|
"BZIP2",
|
||||||
"PUNKTE",
|
"PUNKTE",
|
||||||
|
@ -2023,13 +2023,13 @@ init_locale(const struct locale * lang)
|
||||||
tokens = get_translations(lang, UT_KEYWORDS);
|
tokens = get_translations(lang, UT_KEYWORDS);
|
||||||
for (i=0;i!=MAXKEYWORDS;++i) {
|
for (i=0;i!=MAXKEYWORDS;++i) {
|
||||||
var.i = i;
|
var.i = i;
|
||||||
addtoken(tokens, LOC(lang, keywords[i]), var);
|
if (keywords[i]) addtoken(tokens, LOC(lang, keywords[i]), var);
|
||||||
}
|
}
|
||||||
|
|
||||||
tokens = get_translations(lang, UT_OPTIONS);
|
tokens = get_translations(lang, UT_OPTIONS);
|
||||||
for (i=0;i!=MAXOPTIONS;++i) {
|
for (i=0;i!=MAXOPTIONS;++i) {
|
||||||
var.i = i;
|
var.i = i;
|
||||||
addtoken(tokens, LOC(lang, options[i]), var);
|
if (options[i]) addtoken(tokens, LOC(lang, options[i]), var);
|
||||||
}
|
}
|
||||||
|
|
||||||
tokens = get_translations(lang, UT_TERRAINS);
|
tokens = get_translations(lang, UT_TERRAINS);
|
||||||
|
@ -2859,10 +2859,7 @@ kernel_init(void)
|
||||||
translation_init();
|
translation_init();
|
||||||
|
|
||||||
if (!turn) turn = lastturn();
|
if (!turn) turn = lastturn();
|
||||||
if (turn == 0)
|
rng_init(turn?turn:(int)time(0));
|
||||||
rng_init((int)time(0));
|
|
||||||
else
|
|
||||||
rng_init(turn);
|
|
||||||
if (sqlpatch) {
|
if (sqlpatch) {
|
||||||
sprintf(zBuffer, "%s/patch-%d.sql", datapath(), turn);
|
sprintf(zBuffer, "%s/patch-%d.sql", datapath(), turn);
|
||||||
sql_init(zBuffer);
|
sql_init(zBuffer);
|
||||||
|
|
|
@ -131,7 +131,7 @@ addfaction(const char *email, const char * password,
|
||||||
f->locale = loc;
|
f->locale = loc;
|
||||||
f->subscription = subscription;
|
f->subscription = subscription;
|
||||||
|
|
||||||
f->options = want(O_REPORT) | want(O_ZUGVORLAGE) | want(O_SILBERPOOL) | want(O_COMPUTER) | want(O_COMPRESS) | want(O_ADRESSEN) | want(O_STATISTICS);
|
f->options = want(O_REPORT) | want(O_ZUGVORLAGE) | want(O_COMPUTER) | want(O_COMPRESS) | want(O_ADRESSEN) | want(O_STATISTICS);
|
||||||
|
|
||||||
f->no = unused_faction_id();
|
f->no = unused_faction_id();
|
||||||
addlist(&factions, f);
|
addlist(&factions, f);
|
||||||
|
|
|
@ -40,9 +40,6 @@
|
||||||
#define TODO_POOL
|
#define TODO_POOL
|
||||||
#undef TODO_RESOURCES
|
#undef TODO_RESOURCES
|
||||||
|
|
||||||
static int want_mp = 1 << O_MATERIALPOOL;
|
|
||||||
static int want_sp = 1 << O_SILBERPOOL;
|
|
||||||
|
|
||||||
static const race * rc_stonegolem;
|
static const race * rc_stonegolem;
|
||||||
static const race * rc_irongolem;
|
static const race * rc_irongolem;
|
||||||
|
|
||||||
|
@ -102,19 +99,14 @@ change_resource(unit * u, const resource_type * rtype, int change)
|
||||||
i = change_maxspellpoints(u, change);
|
i = change_maxspellpoints(u, change);
|
||||||
else
|
else
|
||||||
assert(!"undefined resource detected. rtype->uchange not initialized.");
|
assert(!"undefined resource detected. rtype->uchange not initialized.");
|
||||||
assert(i >= 0 && (i < 100000000)); /* Softer Test, daß kein Unfug
|
assert(i >= 0 && (i < 100000000)); /* soft test to catch mischief */
|
||||||
* * passiert */
|
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
get_reservation(const unit * u, const resource_type * rtype)
|
get_reservation(const unit * u, const resource_type * rtype)
|
||||||
{
|
{
|
||||||
faction * f = u->faction;
|
|
||||||
struct reservation * res = u->reservations;
|
struct reservation * res = u->reservations;
|
||||||
if ((rtype==r_silver && !(f->options & want_sp)) || (rtype!=r_silver && !(f->options & want_mp))) {
|
|
||||||
return get_resource(u, rtype);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!rc_stonegolem) init_static();
|
if (!rc_stonegolem) init_static();
|
||||||
|
|
||||||
|
@ -201,10 +193,6 @@ get_pooled(const unit * u, const resource_type * rtype, unsigned int mode, int c
|
||||||
if ((urace(v)->ec_flags & GIVEITEM) == 0) continue;
|
if ((urace(v)->ec_flags & GIVEITEM) == 0) continue;
|
||||||
|
|
||||||
if (v->faction == f) {
|
if (v->faction == f) {
|
||||||
if ((mode & GET_POOLED_FORCE)==0) {
|
|
||||||
if (rtype==r_silver && !(f->options & want_sp)) continue;
|
|
||||||
if (rtype!=r_silver && !(f->options & want_mp)) continue;
|
|
||||||
}
|
|
||||||
mask = (mode >> 3) & (GET_SLACK|GET_RESERVE);
|
mask = (mode >> 3) & (GET_SLACK|GET_RESERVE);
|
||||||
}
|
}
|
||||||
else if (alliedunit(v, f, HELP_MONEY)) mask = (mode >> 6) & (GET_SLACK|GET_RESERVE);
|
else if (alliedunit(v, f, HELP_MONEY)) mask = (mode >> 6) & (GET_SLACK|GET_RESERVE);
|
||||||
|
@ -254,10 +242,6 @@ use_pooled(unit * u, const resource_type * rtype, unsigned int mode, int count)
|
||||||
if ((urace(v)->ec_flags & GIVEITEM) == 0) continue;
|
if ((urace(v)->ec_flags & GIVEITEM) == 0) continue;
|
||||||
|
|
||||||
if (v->faction == f) {
|
if (v->faction == f) {
|
||||||
if ((mode & GET_POOLED_FORCE)==0) {
|
|
||||||
if (rtype==r_silver && !(f->options & want_sp)) continue;
|
|
||||||
if (rtype!=r_silver && !(f->options & want_mp)) continue;
|
|
||||||
}
|
|
||||||
mask = (mode >> 3) & (GET_SLACK|GET_RESERVE);
|
mask = (mode >> 3) & (GET_SLACK|GET_RESERVE);
|
||||||
}
|
}
|
||||||
else if (alliedunit(v, f, HELP_MONEY)) mask = (mode >> 6) & (GET_SLACK|GET_RESERVE);
|
else if (alliedunit(v, f, HELP_MONEY)) mask = (mode >> 6) & (GET_SLACK|GET_RESERVE);
|
||||||
|
|
|
@ -242,21 +242,21 @@ extern const char *parameters[MAXPARAMS];
|
||||||
/* --------------- Reports Typen ------------------------------- */
|
/* --------------- Reports Typen ------------------------------- */
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
O_REPORT, /* 1 */
|
O_REPORT, /* 1 */
|
||||||
O_COMPUTER, /* 2 */
|
O_COMPUTER, /* 2 */
|
||||||
O_ZUGVORLAGE, /* 4 */
|
O_ZUGVORLAGE, /* 4 */
|
||||||
O_SILBERPOOL, /* 8 */
|
O_UNUSED_3,
|
||||||
O_STATISTICS, /* 16 */
|
O_STATISTICS, /* 16 */
|
||||||
O_DEBUG, /* 32 */
|
O_DEBUG, /* 32 */
|
||||||
O_COMPRESS, /* 64 */
|
O_COMPRESS, /* 64 */
|
||||||
O_NEWS, /* 128 */
|
O_NEWS, /* 128 */
|
||||||
O_MATERIALPOOL, /* 256 */
|
O_UNUSED_8,
|
||||||
O_ADRESSEN, /* 512 */
|
O_ADRESSEN, /* 512 */
|
||||||
O_BZIP2, /* 1024 - compress as bzip2 */
|
O_BZIP2, /* 1024 - compress as bzip2 */
|
||||||
O_SCORE, /* 2048 - punkte anzeigen? */
|
O_SCORE, /* 2048 - punkte anzeigen? */
|
||||||
O_SHOWSKCHANGE, /* 4096 - Skillveränderungen anzeigen? */
|
O_SHOWSKCHANGE, /* 4096 - Skillveränderungen anzeigen? */
|
||||||
O_XML, /* 8192 - XML report versenden */
|
O_XML, /* 8192 - XML report versenden */
|
||||||
MAXOPTIONS
|
MAXOPTIONS
|
||||||
};
|
};
|
||||||
|
|
||||||
/* ------------------ Talente ---------------------------------- */
|
/* ------------------ Talente ---------------------------------- */
|
||||||
|
|
|
@ -63,8 +63,7 @@ lua_planmonsters(void)
|
||||||
faction * f = findfaction(MONSTER_FACTION);
|
faction * f = findfaction(MONSTER_FACTION);
|
||||||
|
|
||||||
if (f==NULL) return;
|
if (f==NULL) return;
|
||||||
if (turn == 0) rng_init((int)time(0));
|
rng_init(turn?turn:(int)time(0));
|
||||||
else rng_init(turn);
|
|
||||||
plan_monsters();
|
plan_monsters();
|
||||||
for (u=f->units;u;u=u->nextF) {
|
for (u=f->units;u;u=u->nextF) {
|
||||||
call_script(u);
|
call_script(u);
|
||||||
|
@ -199,9 +198,7 @@ readshortpwds()
|
||||||
static int
|
static int
|
||||||
process_orders(void)
|
process_orders(void)
|
||||||
{
|
{
|
||||||
if (turn == 0) rng_init((int)time(0));
|
rng_init(turn?turn:(int)time(0));
|
||||||
else rng_init(turn);
|
|
||||||
|
|
||||||
#ifdef SHORTPWDS
|
#ifdef SHORTPWDS
|
||||||
readshortpwds("passwords");
|
readshortpwds("passwords");
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in a new issue