forked from github/server
PFL_NOCOORDS is really not needed anywhere. At least I sincerely hope not.
This commit is contained in:
parent
c9a2bb4f24
commit
9ffcff7e2a
9 changed files with 12 additions and 41 deletions
|
@ -12,7 +12,6 @@ without prior permission by the authors of Eressea.
|
||||||
#include "creport.h"
|
#include "creport.h"
|
||||||
|
|
||||||
/* tweakable features */
|
/* tweakable features */
|
||||||
#define ENCODE_SPECIAL 1
|
|
||||||
#define RENDER_CRMESSAGES
|
#define RENDER_CRMESSAGES
|
||||||
#define BUFFERSIZE 32768
|
#define BUFFERSIZE 32768
|
||||||
#define RESOURCECOMPAT
|
#define RESOURCECOMPAT
|
||||||
|
@ -321,11 +320,9 @@ cr_region(variant var, char * buffer, const void * userdata)
|
||||||
region * r = (region *)var.v;
|
region * r = (region *)var.v;
|
||||||
if (r) {
|
if (r) {
|
||||||
plane * p = r->planep;
|
plane * p = r->planep;
|
||||||
if (!p || !(p->flags & PFL_NOCOORDS)) {
|
|
||||||
sprintf(buffer, "%d %d %d", region_x(r, report), region_y(r, report), p?p->id:0);
|
sprintf(buffer, "%d %d %d", region_x(r, report), region_y(r, report), p?p->id:0);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1132,12 +1129,7 @@ cr_output_region(FILE * F, report_context * ctx, seen_region * sr)
|
||||||
fprintf(F, "REGION %d %d\n", region_x(r, f), region_y(r, f));
|
fprintf(F, "REGION %d %d\n", region_x(r, f), region_y(r, f));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
#if ENCODE_SPECIAL
|
fprintf(F, "REGION %d %d %d\n", region_x(r, f), region_y(r, f), r->planep->id);
|
||||||
if (r->planep->flags & PFL_NOCOORDS) fprintf(F, "SPEZIALREGION %d %d\n", encode_region(f, r), r->planep->id);
|
|
||||||
#else
|
|
||||||
if (r->planep->flags & PFL_NOCOORDS) continue;
|
|
||||||
#endif
|
|
||||||
else fprintf(F, "REGION %d %d %d\n", region_x(r, f), region_y(r, f), r->planep->id);
|
|
||||||
}
|
}
|
||||||
fprintf(F, "%d;id\n", r->uid);
|
fprintf(F, "%d;id\n", r->uid);
|
||||||
if (r->land) {
|
if (r->land) {
|
||||||
|
@ -1416,8 +1408,7 @@ report_computer(const char * filename, report_context * ctx, const char * charse
|
||||||
for (bm=f->battles;bm;bm=bm->next) {
|
for (bm=f->battles;bm;bm=bm->next) {
|
||||||
if (!bm->r->planep) fprintf(F, "BATTLE %d %d\n", region_x(bm->r, f), region_y(bm->r, f));
|
if (!bm->r->planep) fprintf(F, "BATTLE %d %d\n", region_x(bm->r, f), region_y(bm->r, f));
|
||||||
else {
|
else {
|
||||||
if (bm->r->planep->flags & PFL_NOCOORDS) fprintf(F, "BATTLESPEC %d %d\n", encode_region(f, bm->r), bm->r->planep->id);
|
fprintf(F, "BATTLE %d %d %d\n", region_x(bm->r, f), region_y(bm->r, f), bm->r->planep->id);
|
||||||
else fprintf(F, "BATTLE %d %d %d\n", region_x(bm->r, f), region_y(bm->r, f), bm->r->planep->id);
|
|
||||||
}
|
}
|
||||||
cr_output_messages(F, bm->msgs, f);
|
cr_output_messages(F, bm->msgs, f);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1374,9 +1374,7 @@ report_template(const char * filename, report_context * ctx, const char * charse
|
||||||
rps_nowrap(F, "");
|
rps_nowrap(F, "");
|
||||||
rnl(F);
|
rnl(F);
|
||||||
pl = getplane(r);
|
pl = getplane(r);
|
||||||
if (pl && fval(pl, PFL_NOCOORDS)) {
|
if (pl && pl->id != 0) {
|
||||||
sprintf(buf, "%s; %s", LOC(f->locale, parameters[P_REGION]), rname(r, f->locale));
|
|
||||||
} else if (pl && pl->id != 0) {
|
|
||||||
sprintf(buf, "%s %d,%d,%d ; %s", LOC(f->locale, parameters[P_REGION]), region_x(r,f),
|
sprintf(buf, "%s %d,%d,%d ; %s", LOC(f->locale, parameters[P_REGION]), region_x(r,f),
|
||||||
region_y(r,f), pl->id, rname(r, f->locale));
|
region_y(r,f), pl->id, rname(r, f->locale));
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -16,10 +16,6 @@
|
||||||
#include <kernel/eressea.h>
|
#include <kernel/eressea.h>
|
||||||
#include "xmlreport.h"
|
#include "xmlreport.h"
|
||||||
|
|
||||||
/* tweakable features */
|
|
||||||
#define ENCODE_SPECIAL 1
|
|
||||||
#define RENDER_CRMESSAGES
|
|
||||||
|
|
||||||
#define XML_ATL_NAMESPACE (const xmlChar *) "http://www.eressea.de/XML/2008/atlantis"
|
#define XML_ATL_NAMESPACE (const xmlChar *) "http://www.eressea.de/XML/2008/atlantis"
|
||||||
#define XML_XML_LANG (const xmlChar *) "lang"
|
#define XML_XML_LANG (const xmlChar *) "lang"
|
||||||
|
|
||||||
|
|
|
@ -1643,14 +1643,8 @@ sail(unit * u, order * ord, boolean move_on_land, region_list **routep)
|
||||||
assert(sh == u->ship || !"ship has sunk, but we didn't notice it");
|
assert(sh == u->ship || !"ship has sunk, but we didn't notice it");
|
||||||
|
|
||||||
if (fval(next_point->terrain, FORBIDDEN_REGION)) {
|
if (fval(next_point->terrain, FORBIDDEN_REGION)) {
|
||||||
plane *pl = getplane(next_point);
|
|
||||||
if (pl && fval(pl, PFL_NOCOORDS)) {
|
|
||||||
ADDMSG(&f->msgs, msg_message("sailforbiddendir",
|
|
||||||
"ship direction", sh, dir));
|
|
||||||
} else {
|
|
||||||
ADDMSG(&f->msgs, msg_message("sailforbidden",
|
ADDMSG(&f->msgs, msg_message("sailforbidden",
|
||||||
"ship region", sh, next_point));
|
"ship region", sh, next_point));
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define PFL_NOCOORDS 1
|
#define PFL_NOCOORDS 1 /* not in use */
|
||||||
#define PFL_NORECRUITS 2
|
#define PFL_NORECRUITS 2
|
||||||
#define PFL_NOALLIANCES 4
|
#define PFL_NOALLIANCES 4
|
||||||
#define PFL_LOWSTEALING 8
|
#define PFL_LOWSTEALING 8
|
||||||
|
|
|
@ -115,15 +115,10 @@ write_regionname(const region * r, const faction * f, char * buffer, size_t size
|
||||||
const struct locale * lang = f ? f->locale : 0;
|
const struct locale * lang = f ? f->locale : 0;
|
||||||
if (r==NULL) {
|
if (r==NULL) {
|
||||||
strcpy(buf, "(null)");
|
strcpy(buf, "(null)");
|
||||||
} else {
|
|
||||||
plane *pl = r->planep;
|
|
||||||
if (pl && fval(pl, PFL_NOCOORDS)) {
|
|
||||||
strncpy(buf, rname(r, lang), size);
|
|
||||||
} else {
|
} else {
|
||||||
snprintf(buf, size, "%s (%d,%d)", rname(r, lang),
|
snprintf(buf, size, "%s (%d,%d)", rname(r, lang),
|
||||||
region_x(r, f), region_y(r, f));
|
region_x(r, f), region_y(r, f));
|
||||||
}
|
}
|
||||||
}
|
|
||||||
buf[size-1] = 0;
|
buf[size-1] = 0;
|
||||||
return buffer;
|
return buffer;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1621,10 +1621,8 @@ f_regionid(const region * r, const faction * f, char * buffer, size_t size)
|
||||||
plane * pl = r->planep;
|
plane * pl = r->planep;
|
||||||
strncpy(buffer, rname(r, f->locale), size);
|
strncpy(buffer, rname(r, f->locale), size);
|
||||||
buffer[size-1]=0;
|
buffer[size-1]=0;
|
||||||
if (pl==NULL || !fval(pl, PFL_NOCOORDS)) {
|
|
||||||
sprintf(buffer+strlen(buffer), " (%d,%d%s%s)", region_x(r,f), region_y(r,f), pl?",":"", pl?pl->name:"");
|
sprintf(buffer+strlen(buffer), " (%d,%d%s%s)", region_x(r,f), region_y(r,f), pl?",":"", pl?pl->name:"");
|
||||||
}
|
}
|
||||||
}
|
|
||||||
return strlen(buffer);
|
return strlen(buffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -49,7 +49,7 @@
|
||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
#define PFL_MUSEUM PFL_NOMONSTERS | PFL_NOCOORDS | PFL_NORECRUITS | PFL_NOGIVE | PFL_NOATTACK | PFL_NOTERRAIN | PFL_NOMAGIC | PFL_NOSTEALTH | PFL_NOTEACH | PFL_NOBUILD | PFL_NOFEED
|
#define PFL_MUSEUM PFL_NOMONSTERS | PFL_NORECRUITS | PFL_NOGIVE | PFL_NOATTACK | PFL_NOTERRAIN | PFL_NOMAGIC | PFL_NOSTEALTH | PFL_NOTEACH | PFL_NOBUILD | PFL_NOFEED
|
||||||
|
|
||||||
attrib_type at_museumexit = {
|
attrib_type at_museumexit = {
|
||||||
"museumexit", NULL, NULL, NULL, a_writeshorts, a_readshorts
|
"museumexit", NULL, NULL, NULL, a_writeshorts, a_readshorts
|
||||||
|
|
|
@ -523,7 +523,6 @@ fix_astralplane(void)
|
||||||
|
|
||||||
if (astralplane==NULL || monsters==NULL) return 0;
|
if (astralplane==NULL || monsters==NULL) return 0;
|
||||||
|
|
||||||
freset(astralplane, PFL_NOCOORDS);
|
|
||||||
freset(astralplane, PFL_NOFEED);
|
freset(astralplane, PFL_NOFEED);
|
||||||
set_ursprung(monsters, astralplane->id, 0, 0);
|
set_ursprung(monsters, astralplane->id, 0, 0);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue