(EFF_OWNER): The assertion that EFF_OWNER implies ef_read() sets

player->owner is no longer used.  Use it to indicate that owner can be
accessed through struct genitem, similar to EFF_XY and EFF_GROUP.
(xdump): Fix ownership checking.  Old version worked only when
nxtitem() set player->owner.

(empfile): Set EFF_OWNER for EF_LOST.  This fixes `xdump lost'
disclosing other countries' losses.
(loststr): Document implications of EFF_OWNER.

(empfile): Set EFF_OWNER for EF_NATION.
(natstr): Rearrange members for EFF_OWNER, document.
(nat_ca): Unused so far.  Clean it up, add most missing selectors.
(fileinit): Use it.  This implements `xdump nation'.

(fileinit): Simplify setting map file size.
This commit is contained in:
Markus Armbruster 2005-05-29 14:14:33 +00:00
parent b111abc2c5
commit 326ac671ba
7 changed files with 33 additions and 36 deletions

View file

@ -49,10 +49,10 @@ struct fileinit fileinit[EF_MAX] = {
{NULL, NULL, NULL, treaty_ca},
{NULL, NULL, NULL, trade_ca},
{NULL, NULL, NULL, NULL}, /* power */
{NULL, NULL, NULL, NULL}, /* nation */
{NULL, NULL, NULL, nat_ca}, /* nation */
{NULL, NULL, NULL, loan_ca},
{NULL, NULL, NULL, NULL}, /* map */
{NULL, NULL, NULL, NULL}, /* map */
{NULL, NULL, NULL, NULL}, /* map, a.k.a. true bmap */
{NULL, NULL, NULL, NULL}, /* (working) bmap */
{NULL, NULL, NULL, commodity_ca},
{NULL, NULL, NULL, lost_ca}
};
@ -71,9 +71,7 @@ ef_init(void)
ef->postread = fi->postread;
ef->prewrite = fi->prewrite;
ef->cadef = fi->cadef;
/* We have to set the size for the map and bmap files at
runtime. */
if (i == EF_MAP || i == EF_BMAP)
ef->size = (WORLD_X * WORLD_Y) / 2;
}
empfile[EF_MAP].size = empfile[EF_BMAP].size = (WORLD_X * WORLD_Y) / 2;
}