diff --git a/src/common/kernel/eressea.h b/src/common/kernel/eressea.h index 4c7401e3e..cccef8bec 100644 --- a/src/common/kernel/eressea.h +++ b/src/common/kernel/eressea.h @@ -176,6 +176,7 @@ struct building_type; #define NOLASTORDER_VERSION 320 /* do not use lastorder */ #define SPELLNAME_VERSION 321 /* reference spells by name */ #define TERRAIN_VERSION 322 /* terrains are a full type and saved by name */ +#define REGIONITEMS_VERSION 323 /* regions have items */ #define MIN_VERSION CURSETYPE_VERSION #define REGIONOWNERS_VERSION 400 @@ -184,7 +185,7 @@ struct building_type; #ifdef ENEMIES # define RELEASE_VERSION ENEMIES_VERSION #else -# define RELEASE_VERSION TERRAIN_VERSION +# define RELEASE_VERSION REGIONITEMS_VERSION #endif #if RESOURCE_CONVERSION diff --git a/src/common/kernel/save.c b/src/common/kernel/save.c index 53c46b5ad..baf909051 100644 --- a/src/common/kernel/save.c +++ b/src/common/kernel/save.c @@ -1410,6 +1410,9 @@ readregion(FILE * F, short x, short y) assert(itype->rtype->ltype); r_setdemand(r, itype->rtype->ltype, ri(F)); } + if (global.data_version>=REGIONITEMS_VERSION) { + read_items(F, &r->land->items); + } } a_read(F, &r->attribs); @@ -1462,6 +1465,10 @@ writeregion(FILE * F, const region * r) wi(F, demand->value); } fputs("end \n", F); +#if RELEASE_VERSION>=REGIONITEMS_VERSION + write_items(F, r->land->items); + wnl(F); +#endif } a_write(F, r->attribs); wnl(F);