Mercurial > hg > batmud > maputils
changeset 2409:22be4530ad63
Generate extra information in Batclient markers.xml.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Wed, 10 Nov 2021 11:06:48 +0200 |
parents | f2e639d72f6f |
children | d3950686f759 |
files | src/mkloc.c |
diffstat | 1 files changed, 48 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/src/mkloc.c Wed Nov 10 11:02:23 2021 +0200 +++ b/src/mkloc.c Wed Nov 10 11:06:48 2021 +0200 @@ -1051,7 +1051,54 @@ tmp->added.day, tmp->added.month, tmp->added.year); } - fprintf(outFile, "/>\n"); + fprintf(outFile, ">"); + + // Location alternative names + if (tmp->nnames > 1) + { + fprintf(outFile, "<altnames>"); + for (int n = 1; n < tmp->nnames; n++) + { + const char *tmps = locGetAreaNameType(tmp->names[n].flags, TRUE); + fprintf(outFile, "<name"); + if (tmps != NULL) + fprintf(outFile, " type=\"original\""); + fprintf(outFile, ">"); + fputse(tmp->names[n].name, outFile); + fprintf(outFile, "</name>"); + } + fprintf(outFile, "</altnames>"); + } + + // Creators or secret societies + if (tmp->ncreators > 0) + { + if (tmp->flags & LOCF_M_PCITY) + { + fprintf(outFile, "<societies>"); + for (int n = 0; n < tmp->ncreators; n++) + { + fprintf(outFile, "<name>"); + fputse(tmp->creators[n].name, outFile); + fprintf(outFile, "</name>"); + } + fprintf(outFile, "</societies>"); + } + else + { + fprintf(outFile, "<creators>"); + for (int n = 0; n < tmp->ncreators; n++) + { + fprintf(outFile, "<coder role=\"%s\">", + locGetAreaCreatorRole(tmp->creators[n].flags, TRUE)); + fputse(tmp->creators[n].name, outFile); + fprintf(outFile, "</coder>"); + } + fprintf(outFile, "</creators>"); + } + } + + fprintf(outFile, "</marker>\n"); } fprintf(outFile, "</markers>\n");