diff --git a/src/common/kernel/eressea.c b/src/common/kernel/eressea.c index eaae5ff04..35321b871 100644 --- a/src/common/kernel/eressea.c +++ b/src/common/kernel/eressea.c @@ -1251,6 +1251,28 @@ extern int fuzzy_hits; boolean enable_fuzzy = false; #endif /* FUZZY_BASE36 */ +static faction * + makemonsters(void) +{ + faction * f = calloc(sizeof(faction), 1); + f->next=factions; + f->race=new_race[RC_TEMPLATE]; + f->alive=1; + f->email=strdup(""); + f->lastorders=0; + f->locale=default_locale; + + factions=f; + f->options = Pow(O_REPORT); + f->no=MONSTER_FACTION; + register_faction_id(f->no); + f->unique_id = ++max_unique_id; + f->name=strdup("Monster"); + f->passw=strdup("abc123"); + fhash(f); + return f; +} + faction * findfaction (int n) { @@ -1278,7 +1300,7 @@ findfaction (int n) } } #endif /* FUZZY_BASE36 */ - + if (n==MONSTER_FACTION) return makemonsters(); return NULL; } diff --git a/src/common/kernel/region.c b/src/common/kernel/region.c index 610e9cd96..448d23d76 100644 --- a/src/common/kernel/region.c +++ b/src/common/kernel/region.c @@ -690,7 +690,7 @@ new_region(int x, int y) region *r = rfindhash(x, y); if (r) { - fprintf(stderr, "\ndoppelte regionen entdeckt: %s\n", regionname(r, NULL)); + fprintf(stderr, "\ndoppelte regionen entdeckt: %s(%d,%d)\n", regionname(r, NULL), x, y); if (r->units) fprintf(stderr, "doppelte region enthält einheiten\n"); return r; diff --git a/src/eressea/korrektur.c b/src/eressea/korrektur.c index f0da54660..07dd1555a 100644 --- a/src/eressea/korrektur.c +++ b/src/eressea/korrektur.c @@ -2651,7 +2651,7 @@ dump_sql(void) if (f->unique_id==0) { f->unique_id = ++max_unique_id; } - if (f->age!=1) { + if (f->age!=1 && f->no!=MONSTER_FACTION) { fprintf(sqlstream, "INSERT INTO users (id, email) VALUES (%d, '%s');\n", f->unique_id, f->email); fprintf(sqlstream, "INSERT INTO factions (id, user, name, password, race, locale, lastorders, banner, email) " diff --git a/src/mapper/mapper.c b/src/mapper/mapper.c index 6f1f540f1..5893c7ec5 100644 --- a/src/mapper/mapper.c +++ b/src/mapper/mapper.c @@ -158,8 +158,25 @@ init_win(int x, int y) { static int hl; int politkarte = 0; +int +RegionColor(const region *r) { + static int usecolor=0; + if (!usecolor) { + start_color(); + init_pair(T_PLAIN, COLOR_GREEN, COLOR_BLACK); + init_pair(T_SWAMP, COLOR_RED, COLOR_BLACK); + init_pair(T_OCEAN, COLOR_BLUE, COLOR_BLACK); + init_pair(T_GLACIER, COLOR_WHITE, COLOR_BLACK); + init_pair(T_HIGHLAND, COLOR_YELLOW, COLOR_BLACK); + init_pair(T_DESERT, COLOR_CYAN, COLOR_BLACK); + init_pair(T_MOUNTAIN, COLOR_WHITE, COLOR_BLACK); + usecolor=1; + } + return COLOR_PAIR(rterrain(r)); +} + chtype -RegionSymbol(region *r) { +RegionSymbol(const region *r) { chtype rs; int p; @@ -300,7 +317,7 @@ static void readfactions(void) { FILE * F = fopen("factions.txt", "r"); - region * r; + locale * german = find_locale("de"); while (!feof(F)) { int x, y; @@ -405,6 +422,7 @@ drawmap(boolean maponly) { addch(' '); if (r) { + int rc = RegionColor(r); if ((hl == -2 && r->units) || (hl == -3 && r->buildings) || (hl == -4 && r->ships) || @@ -417,8 +435,11 @@ drawmap(boolean maponly) { addch(rs | A_REVERSE); else if (is_tagged(r)) addch(rs | A_BOLD); - else + else { + attrset(rc | A_NORMAL); addch(rs); + attrset(A_NORMAL); + } } else addch(rs); }