diff --git a/src/common/gamecode/report.c b/src/common/gamecode/report.c index 4f1f4a9e2..beadbd23c 100644 --- a/src/common/gamecode/report.c +++ b/src/common/gamecode/report.c @@ -2606,12 +2606,23 @@ prepare_report(faction * f) for (r = firstregion(f); r != end; r = r->next) { attrib *ru; unit * u; + plane * p = rplane(r); unsigned char mode = see_none; boolean dis = false; #if DBG_CACHE ++ctries; #endif - for (u = r->units; u; u = u->next) { + if (p) { + watcher * w = p->watchers; + while (w) { + if (f==w->faction) { + mode = w->mode; + break; + } + w = w->next; + } + } + if (modeunits; u; u = u->next) { if (u->faction == f) { if (u->race != new_race[RC_SPELL] || u->number == RS_FARVISION) { mode = see_unit; @@ -2623,7 +2634,7 @@ prepare_report(faction * f) } } - if (mode==see_none) for (ru = a_find(r->attribs, &at_travelunit); ru; ru = ru->nexttype) { + if (modeattribs, &at_travelunit); ru; ru = ru->nexttype) { unit * u = (unit*)ru->data.v; if (u->faction == f) { mode = see_travel; @@ -2631,7 +2642,7 @@ prepare_report(faction * f) } } - if (mode==see_none && rterrain(r) == T_OCEAN) { + if (modeminy = ri(F); pl->maxy = ri(F); pl->flags = ri(F); + if (global.data_version>WATCHERS_VERSION) { + char * s = NULL; + rds(F, &s); + while (strcmp(s, "end")!=0) { + watcher * w = calloc(sizeof(watcher),1); + int fno = ri36(F); + w->mode = (unsigned char)ri(F); + w->next = pl->watchers; + pl->watchers = w; + ur_add((void*)fno, &w->faction, resolve_faction); + } + free(s); + } a_read(F, &pl->attribs); addlist(&planes, pl); } @@ -1796,6 +1809,9 @@ writegame(char *path, char quiet) wnl(F); for(pl = planes; pl; pl=pl->next) { +#if RELEASE_VERSION >= WATCHERS_VERSION + watcher * w; +#endif wi(F, pl->id); ws(F, pl->name); wi(F, pl->minx); @@ -1803,6 +1819,17 @@ writegame(char *path, char quiet) wi(F, pl->miny); wi(F, pl->maxy); wi(F, pl->flags); +#if RELEASE_VERSION >= WATCHERS_VERSION + w = pl->watchers; + while (w) { + if (w->faction) { + wi36(F, w->faction->no); + wi(F, w->mode); + } + w = w->next; + } + ws(F, "end"); +#endif a_write(F, pl->attribs); wnl(F); } diff --git a/src/eressea/korrektur.c b/src/eressea/korrektur.c index 78d9c72e4..4c0867e5c 100644 --- a/src/eressea/korrektur.c +++ b/src/eressea/korrektur.c @@ -2470,7 +2470,7 @@ peasant_adjustment(void) terrain_t ter; int sum, avg, c; double freeall, pool; /* long long is illegal */ - long long s; + double s; region *r; s = 0; @@ -2601,8 +2601,34 @@ static int fix_astralplane(void) { plane * astralplane = getplanebyname("Astralraum"); - freset(astralplane, PFL_NOCOORDS); - set_ursprung(findfaction(MONSTER_FACTION), astralplane->id, 0, 0); + if (astralplane) { + freset(astralplane, PFL_NOCOORDS); + set_ursprung(findfaction(MONSTER_FACTION), astralplane->id, 0, 0); + } + return 0; +} + +static int +fix_watchers(void) +{ + plane * p = getplanebyid (59034966); + if (p) { + faction * f = findfaction(atoi36("gm04")); + watcher * w = calloc(sizeof(watcher), 1); + w->faction = f; + w->mode = see_unit; + w->next = p->watchers; + p->watchers = w; + } + p = getplanebyid(1137); + if (p) { + faction * f = findfaction(atoi36("rr")); + watcher * w = calloc(sizeof(watcher), 1); + w->faction = f; + w->mode = see_unit; + w->next = p->watchers; + p->watchers = w; + } return 0; } @@ -2654,6 +2680,7 @@ korrektur(void) /* fix_unitrefs(); */ stats(); do_once("sql2", dump_sql()); + do_once("fw01", fix_watchers()); #if NEW_RESOURCEGROWTH /* do not remove do_once calls - old datafiles need them! */ do_once("rgrw", convert_resources());