Merge branch 'master' into develop

Conflicts:
	tests/runtests.bat
This commit is contained in:
Enno Rehling 2015-09-12 21:00:28 +02:00
commit 8fa3234159
18 changed files with 66 additions and 106 deletions

View File

@ -9,6 +9,6 @@ fi
cd $ERESSEA/game-$GAME cd $ERESSEA/game-$GAME
echo "running turn $TURN, game $GAME" echo "running turn $TURN, game $GAME"
$ERESSEA/server/bin/eressea -v1 -t $TURN run-turn.lua $ERESSEA/server/bin/eressea -v3 -t $TURN run-turn.lua
mkdir -p log mkdir -p log
ln -f eressea.log log/eressea.log.$TURN ln -f eressea.log log/eressea.log.$TURN

View File

@ -3748,8 +3748,6 @@ static int battle_report(battle * b)
} }
} }
if (verbosity > 0)
log_printf(stdout, " %d", b->turn);
fflush(stdout); fflush(stdout);
for (bf = b->factions; bf; bf = bf->next) { for (bf = b->factions; bf; bf = bf->next) {
@ -4340,8 +4338,7 @@ void do_battle(region * r)
do_combatmagic(b, DO_PRECOMBATSPELL); do_combatmagic(b, DO_PRECOMBATSPELL);
print_stats(b); /* gibt die Kampfaufstellung aus */ print_stats(b); /* gibt die Kampfaufstellung aus */
if (verbosity > 0) log_debug("battle in %s (%d, %d) : ", regionname(r, 0), r->x, r->y);
log_printf(stdout, "%s (%d, %d) : ", rname(r, default_locale), r->x, r->y);
for (; battle_report(b) && b->turn <= max_turns; ++b->turn) { for (; battle_report(b) && b->turn <= max_turns; ++b->turn) {
if (bdebug) { if (bdebug) {
@ -4353,9 +4350,6 @@ void do_battle(region * r)
} }
if (verbosity > 0)
log_printf(stdout, "\n");
/* Auswirkungen berechnen: */ /* Auswirkungen berechnen: */
aftermath(b); aftermath(b);
if (rule_force_leave(FORCE_LEAVE_POSTCOMBAT)) { if (rule_force_leave(FORCE_LEAVE_POSTCOMBAT)) {

View File

@ -1,3 +1,3 @@
#define VERSION_MAJOR 3 #define VERSION_MAJOR 3
#define VERSION_MINOR 6 #define VERSION_MINOR 6
#define VERSION_BUILD 2 #define VERSION_BUILD 3

View File

@ -82,7 +82,6 @@ without prior permission by the authors of Eressea.
#include <string.h> #include <string.h>
/* imports */ /* imports */
extern int verbosity;
bool opt_cr_absolute_coords = false; bool opt_cr_absolute_coords = false;
/* globals */ /* globals */

View File

@ -441,8 +441,6 @@ static attrib_type at_npcfaction = {
ATF_UNIQUE ATF_UNIQUE
}; };
int verbosity = 1;
FILE *debug; FILE *debug;
/* ----------------------------------------------------------------------- */ /* ----------------------------------------------------------------------- */

View File

@ -315,28 +315,10 @@ extern "C" {
extern bool battledebug; extern bool battledebug;
extern bool sqlpatch; extern bool sqlpatch;
extern bool lomem; /* save memory */ extern bool lomem; /* save memory */
extern int turn; extern int turn;
extern int verbosity;
/** report options **/
extern const char *options[MAXOPTIONS];
extern struct helpmode helpmodes[];
extern const char *parameters[];
extern const char *localenames[];
extern settings global;
extern bool battledebug;
extern bool sqlpatch;
extern bool lomem; /* save memory */
extern int turn;
extern int verbosity;
extern bool getunitpeasants; extern bool getunitpeasants;
/** report options **/ extern const char *options[MAXOPTIONS]; /* report options */
extern const char *options[MAXOPTIONS];
#ifdef __cplusplus #ifdef __cplusplus
} }

View File

@ -613,8 +613,7 @@ void remove_empty_factions(void)
ursprung *ur = f->ursprung; ursprung *ur = f->ursprung;
while (ur && ur->id != 0) while (ur && ur->id != 0)
ur = ur->next; ur = ur->next;
if (verbosity >= 2) log_debug("dead: %s", factionname(f));
log_printf(stdout, "\t%s\n", factionname(f));
/* Einfach in eine Datei schreiben und später vermailen */ /* Einfach in eine Datei schreiben und später vermailen */

View File

@ -4024,11 +4024,10 @@ void process(void)
region *r; region *r;
processor *pglobal = proc; processor *pglobal = proc;
if (verbosity >= 3) log_debug("- Step %u", prio);
printf("- Step %u\n", prio);
while (proc && proc->priority == prio) { while (proc && proc->priority == prio) {
if (proc->name && verbosity >= 1) if (proc->name)
log_printf(stdout, " - %s\n", proc->name); log_debug(" - %s", proc->name);
proc = proc->next; proc = proc->next;
} }
@ -4124,8 +4123,7 @@ void process(void)
} }
} }
if (verbosity >= 3) log_debug("\n - Leere Gruppen loeschen...\n");
printf("\n - Leere Gruppen loeschen...\n");
for (f = factions; f; f = f->next) { for (f = factions; f; f = f->next) {
group **gp = &f->groups; group **gp = &f->groups;
while (*gp) { while (*gp) {

View File

@ -88,9 +88,7 @@ list_selection *do_selection(list_selection * sel, const char *title,
width = (int)strlen(s->str); width = (int)strlen(s->str);
} }
++height; ++height;
if (verbosity >= 5) { log_debug("s %s w %d h %d\n", s->str, width, height);
log_printf(stdout, "s %s w %d h %d\n", s->str, width, height);
}
} }
if (height == 0 || width == 0) if (height == 0 || width == 0)
return 0; return 0;
@ -99,8 +97,7 @@ list_selection *do_selection(list_selection * sel, const char *title,
if (height + 2 > SY) if (height + 2 > SY)
height = SY - 2; height = SY - 2;
if (verbosity >= 5) log_debug("w %d h %d\n", width, height);
log_printf(stdout, "w %d h %d\n", width, height);
wn = wn =
newwin(height + 2, width + 4, (SY - height - 2) / 2, (SX - width - 4) / 2); newwin(height + 2, width + 4, (SY - height - 2) / 2, (SX - width - 4) / 2);

View File

@ -44,6 +44,7 @@ static const char *logfile = "eressea.log";
static const char *luafile = 0; static const char *luafile = 0;
static const char *inifile = "eressea.ini"; static const char *inifile = "eressea.ini";
static int memdebug = 0; static int memdebug = 0;
static int verbosity = 1;
static void load_inifile(dictionary * d) static void load_inifile(dictionary * d)
{ {
@ -202,10 +203,10 @@ static int parse_args(int argc, char **argv, int *exitcode)
log_stderr = LOG_CPERROR | LOG_CPWARNING; log_stderr = LOG_CPERROR | LOG_CPWARNING;
break; break;
case 3: case 3:
log_stderr = LOG_CPERROR | LOG_CPWARNING | LOG_CPDEBUG; log_stderr = LOG_CPERROR | LOG_CPWARNING | LOG_CPINFO;
break; break;
default: default:
log_stderr = LOG_CPERROR | LOG_CPWARNING | LOG_CPDEBUG | LOG_CPINFO; log_stderr = LOG_CPERROR | LOG_CPWARNING | LOG_CPINFO | LOG_CPDEBUG;
break; break;
} }

View File

@ -943,11 +943,9 @@ void spawn_dragons(void)
fset(u, UFL_ISNEW | UFL_MOVED); fset(u, UFL_ISNEW | UFL_MOVED);
equip_unit(u, get_equipment("monster_dragon")); equip_unit(u, get_equipment("monster_dragon"));
if (verbosity >= 2) { log_debug("spawning %d %s in %s.\n", u->number,
log_printf(stdout, "%d %s in %s.\n", u->number, LOC(default_locale,
LOC(default_locale, rc_name_s(u_race(u), (u->number == 1) ? NAME_SINGULAR : NAME_PLURAL)), regionname(r, NULL));
rc_name_s(u_race(u), (u->number == 1) ? NAME_SINGULAR : NAME_PLURAL)), regionname(r, NULL));
}
name_unit(u); name_unit(u);
@ -976,6 +974,7 @@ void spawn_undead(void)
/* Chance 0.1% * chaosfactor */ /* Chance 0.1% * chaosfactor */
if (r->land && unburied > r->land->peasants / 20 if (r->land && unburied > r->land->peasants / 20
&& rng_int() % 10000 < (100 + 100 * chaosfactor(r))) { && rng_int() % 10000 < (100 + 100 * chaosfactor(r))) {
message *msg;
unit *u; unit *u;
/* es ist sinnfrei, wenn irgendwo im Wald 3er-Einheiten Untote entstehen. /* es ist sinnfrei, wenn irgendwo im Wald 3er-Einheiten Untote entstehen.
* Lieber sammeln lassen, bis sie mindestens 5% der Bevölkerung sind, und * Lieber sammeln lassen, bis sie mindestens 5% der Bevölkerung sind, und
@ -1018,14 +1017,10 @@ void spawn_undead(void)
deathcounts(r, -undead); deathcounts(r, -undead);
name_unit(u); name_unit(u);
if (verbosity >= 2) { log_debug("spawning %d %s in %s.\n", u->number,
log_printf(stdout, "%d %s in %s.\n", u->number, LOC(default_locale,
LOC(default_locale, rc_name_s(u_race(u), (u->number == 1) ? NAME_SINGULAR : NAME_PLURAL)), regionname(r, NULL));
rc_name_s(u_race(u), (u->number == 1) ? NAME_SINGULAR : NAME_PLURAL)), regionname(r, NULL)); msg = msg_message("undeadrise", "region", r);
}
{
message *msg = msg_message("undeadrise", "region", r);
add_message(&r->msgs, msg); add_message(&r->msgs, msg);
for (u = r->units; u; u = u->next) for (u = r->units; u; u = u->next)
freset(u->faction, FFL_SELECT); freset(u->faction, FFL_SELECT);
@ -1036,7 +1031,6 @@ void spawn_undead(void)
add_message(&u->faction->msgs, msg); add_message(&u->faction->msgs, msg);
} }
msg_release(msg); msg_release(msg);
}
} }
else { else {
int i = deathcount(r); int i = deathcount(r);

View File

@ -97,7 +97,6 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#include <limits.h> #include <limits.h>
#include <stdlib.h> #include <stdlib.h>
extern int verbosity;
extern int *storms; extern int *storms;
extern int weeks_per_month; extern int weeks_per_month;
extern int months_per_year; extern int months_per_year;

View File

@ -1564,9 +1564,7 @@ int write_reports(faction * f, time_t ltime)
log_warning("errno was %d before writing reports", errno); log_warning("errno was %d before writing reports", errno);
errno = 0; errno = 0;
} }
if (verbosity >= 2) { log_debug("Reports for %s:", factionname(f));
log_printf(stdout, "Reports for %s:", factionname(f));
}
for (rtype = report_types; rtype != NULL; rtype = rtype->next) { for (rtype = report_types; rtype != NULL; rtype = rtype->next) {
if (f->options & rtype->flag) { if (f->options & rtype->flag) {
int error; int error;
@ -1659,9 +1657,7 @@ int reports(void)
int retval = 0; int retval = 0;
char path[MAX_PATH]; char path[MAX_PATH];
if (verbosity >= 1) { log_info("Writing reports for turn %d:", turn);
log_printf(stdout, "Writing reports for turn %d:", turn);
}
report_donations(); report_donations();
remove_empty_units(); remove_empty_units();

View File

@ -34,6 +34,7 @@
/* util includes */ /* util includes */
#include <util/attrib.h> #include <util/attrib.h>
#include <util/base36.h> #include <util/base36.h>
#include <util/log.h>
#include <util/rand.h> #include <util/rand.h>
#include <util/rng.h> #include <util/rng.h>
@ -871,9 +872,7 @@ static fighter *summon_allies(const fighter *fi, const race *rc, int number) {
a->data.ca[1] = 100; a->data.ca[1] = 100;
a_add(&u->attribs, a); a_add(&u->attribs, a);
msg = msg = msg_message("sp_wolfhowl_effect", "mage amount race", mage, u->number, rc);
msg_message("sp_wolfhowl_effect", "mage amount race",
mage, u->number, rc);
message_all(b, msg); message_all(b, msg);
msg_release(msg); msg_release(msg);
@ -882,11 +881,12 @@ static fighter *summon_allies(const fighter *fi, const race *rc, int number) {
int sp_igjarjuk(castorder *co) { int sp_igjarjuk(castorder *co) {
unit *u; unit *u;
fighter * fi = co->magician.fig; fighter *fm = co->magician.fig, *fi;
const race *rc = get_race(RC_WYRM); const race *rc = get_race(RC_WYRM);
fi = summon_allies(fi, rc, 1); fi = summon_allies(fm, rc, 1);
u = fi->unit; u = fi->unit;
unit_setname(u, "Igjarjuk"); unit_setname(u, "Igjarjuk");
log_info("%s summons Igjarjuk in %s", unitname(fm->unit), regionname(u->region, 0));
return co->level; return co->level;
} }

View File

@ -17,40 +17,40 @@
extern "C" { extern "C" {
#endif #endif
struct fighter; struct castorder;
/* Kampfzauber */ /* Kampfzauber */
extern int sp_fumbleshield(struct castorder * co); int sp_fumbleshield(struct castorder * co);
extern int sp_shadowknights(struct castorder * co); int sp_shadowknights(struct castorder * co);
extern int sp_combatrosthauch(struct castorder * co); int sp_combatrosthauch(struct castorder * co);
extern int sp_kampfzauber(struct castorder * co); int sp_kampfzauber(struct castorder * co);
extern int sp_healing(struct castorder * co); int sp_healing(struct castorder * co);
extern int sp_keeploot(struct castorder * co); int sp_keeploot(struct castorder * co);
extern int sp_reanimate(struct castorder * co); int sp_reanimate(struct castorder * co);
extern int sp_chaosrow(struct castorder * co); int sp_chaosrow(struct castorder * co);
extern int sp_flee(struct castorder * co); int sp_flee(struct castorder * co);
extern int sp_berserk(struct castorder * co); int sp_berserk(struct castorder * co);
extern int sp_tiredsoldiers(struct castorder * co); int sp_tiredsoldiers(struct castorder * co);
extern int sp_reeling_arrows(struct castorder * co); int sp_reeling_arrows(struct castorder * co);
extern int sp_denyattack(struct castorder * co); int sp_denyattack(struct castorder * co);
extern int sp_sleep(struct castorder * co); int sp_sleep(struct castorder * co);
extern int sp_windshield(struct castorder * co); int sp_windshield(struct castorder * co);
extern int sp_strong_wall(struct castorder * co); int sp_strong_wall(struct castorder * co);
extern int sp_petrify(struct castorder * co); int sp_petrify(struct castorder * co);
extern int sp_hero(struct castorder * co); int sp_hero(struct castorder * co);
extern int sp_frighten(struct castorder * co); int sp_frighten(struct castorder * co);
extern int sp_mindblast(struct castorder * co); int sp_mindblast(struct castorder * co);
extern int sp_mindblast_temp(struct castorder * co); int sp_mindblast_temp(struct castorder * co);
extern int sp_speed(struct castorder * co); int sp_speed(struct castorder * co);
extern int sp_wolfhowl(struct castorder * co); int sp_wolfhowl(struct castorder * co);
extern int sp_igjarjuk(struct castorder * co); int sp_igjarjuk(struct castorder * co);
extern int sp_dragonodem(struct castorder * co); int sp_dragonodem(struct castorder * co);
extern int sp_reduceshield(struct castorder * co); int sp_reduceshield(struct castorder * co);
extern int sp_armorshield(struct castorder * co); int sp_armorshield(struct castorder * co);
extern int sp_stun(struct castorder * co); int sp_stun(struct castorder * co);
extern int sp_undeadhero(struct castorder * co); int sp_undeadhero(struct castorder * co);
extern int sp_shadowcall(struct castorder * co); int sp_shadowcall(struct castorder * co);
extern int sp_immolation(struct castorder * co); int sp_immolation(struct castorder * co);
#ifdef __cplusplus #ifdef __cplusplus
} }

View File

@ -30,8 +30,8 @@ extern "C" {
#define LOG_FLUSH 0x01 #define LOG_FLUSH 0x01
#define LOG_CPWARNING 0x02 #define LOG_CPWARNING 0x02
#define LOG_CPERROR 0x04 #define LOG_CPERROR 0x04
#define LOG_CPDEBUG 0x08 #define LOG_CPINFO 0x08
#define LOG_CPINFO 0x10 #define LOG_CPDEBUG 0x10
extern int log_flags; extern int log_flags;
extern int log_stderr; extern int log_stderr;

BIN
tests/data/test.dat Normal file

Binary file not shown.

3
tests/orders.txt Normal file
View File

@ -0,0 +1,3 @@
ERESSEA 72vx "naeg86"
EINHEIT nqLx
BENENNEN EINHEIT 'Goldene Herde'