forked from github/server
watchers sollten jetzt wieder ganze reports kriegen
This commit is contained in:
parent
63faa991bf
commit
372714f291
|
@ -1787,6 +1787,7 @@ lastregion (faction * f)
|
|||
region *r = f->last;
|
||||
if (!r && f->units) {
|
||||
for (r = firstregion(f); r; r = r->next) {
|
||||
plane * p = rplane(r);
|
||||
unit *u;
|
||||
attrib *ru;
|
||||
for (u = r->units; u; u = u->next) {
|
||||
|
@ -1808,6 +1809,10 @@ lastregion (faction * f)
|
|||
continue;
|
||||
if (check_leuchtturm(r, f))
|
||||
f->last = r->next;
|
||||
if (p && is_watcher(p, f)) {
|
||||
f->first = r;
|
||||
return r;
|
||||
}
|
||||
}
|
||||
}
|
||||
return f->last;
|
||||
|
@ -1823,6 +1828,7 @@ firstregion (faction * f)
|
|||
for (r = regions; r; r = r->next) {
|
||||
attrib *ru;
|
||||
unit *u;
|
||||
plane * p = rplane(r);
|
||||
for (u = r->units; u; u = u->next) {
|
||||
if (u->faction == f) {
|
||||
f->first = r;
|
||||
|
@ -1842,6 +1848,10 @@ firstregion (faction * f)
|
|||
f->first = r;
|
||||
return r;
|
||||
}
|
||||
if (p && is_watcher(p, f)) {
|
||||
f->first = r;
|
||||
return r;
|
||||
}
|
||||
}
|
||||
f->first = regions;
|
||||
return regions;
|
||||
|
|
|
@ -255,3 +255,13 @@ read_plane_reference(plane ** pp, FILE * F)
|
|||
if (*pp==NULL) ur_add((void*)i, (void**)pp, resolve_plane);
|
||||
return AT_READ_OK;
|
||||
}
|
||||
|
||||
boolean
|
||||
is_watcher(const struct plane * p, const struct faction * f)
|
||||
{
|
||||
struct watcher * w;
|
||||
if (!p) return false;
|
||||
w = p->watchers;
|
||||
while (w && w->faction!=f) w=w->next;
|
||||
return (w!=NULL);
|
||||
}
|
|
@ -71,7 +71,7 @@ void set_ursprung(struct faction *f, int id, int x, int y);
|
|||
plane * create_new_plane(int id, const char *name, int minx, int maxx, int miny, int maxy, int flags);
|
||||
plane * getplanebyname(const char *);
|
||||
extern int rel_to_abs(const struct plane *pl, const struct faction * f, int rel, unsigned char index);
|
||||
|
||||
extern boolean is_watcher(const struct plane * p, const struct faction * f);
|
||||
extern void * resolve_plane(void * data);
|
||||
extern void write_plane_reference(const plane * p, FILE * F);
|
||||
extern int read_plane_reference(plane ** pp, FILE * F);
|
||||
|
|
|
@ -1917,12 +1917,13 @@ regatta_quest(void)
|
|||
{
|
||||
plane * p = getplanebyname("Regatta");
|
||||
if (p) {
|
||||
fset(p, PFL_NOMONSTERS);
|
||||
fset(p, PFL_SEESPECIAL);
|
||||
return resize_plane(p, 40);
|
||||
#ifdef REGATTA_QUESTMASTER /* "gregorjochmann@gmx.de" */
|
||||
} else {
|
||||
region * center;
|
||||
p = gm_addplane(40, PFL_NORECRUITS, "Regatta");
|
||||
p = gm_addplane(40, PFL_NORECRUITS|PFL_NOMONSTERS|PFL_SEESPECIAL, "Regatta");
|
||||
center = findregion(p->minx+(p->maxx-p->minx)/2, p->miny+(p->maxy-p->miny)/2);
|
||||
gm_addfaction(REGATTA_QUESTMASTER, p, center);
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue