region player_flags follow-up correction [trunk only]
This commit is contained in:
+1
-1
@@ -136,4 +136,4 @@ move all flags that are system or port specific from flag struct to sysflags
|
|||||||
all fields in flags struct are unconditionally present
|
all fields in flags struct are unconditionally present
|
||||||
monst cham field now a short and uses mons[] index
|
monst cham field now a short and uses mons[] index
|
||||||
rearrange some monster ordering to follow rule #2 listed at top of monst.c
|
rearrange some monster ordering to follow rule #2 listed at top of monst.c
|
||||||
|
change region player_flags to more appropriate unsigned int instead of boolean
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
* Incrementing EDITLEVEL can be used to force invalidation of old bones
|
* Incrementing EDITLEVEL can be used to force invalidation of old bones
|
||||||
* and save files.
|
* and save files.
|
||||||
*/
|
*/
|
||||||
#define EDITLEVEL 17
|
#define EDITLEVEL 18
|
||||||
|
|
||||||
#define COPYRIGHT_BANNER_A \
|
#define COPYRIGHT_BANNER_A \
|
||||||
"NetHack, Copyright 1985-2004"
|
"NetHack, Copyright 1985-2004"
|
||||||
|
|||||||
@@ -21,6 +21,14 @@ typedef boolean FDECL((*callback_proc), (genericptr_t, genericptr_t));
|
|||||||
#define set_heros_fault(r) ((r)->player_flags &= ~REG_NOT_HEROS)
|
#define set_heros_fault(r) ((r)->player_flags &= ~REG_NOT_HEROS)
|
||||||
#define clear_heros_fault(r) ((r)->player_flags |= REG_NOT_HEROS)
|
#define clear_heros_fault(r) ((r)->player_flags |= REG_NOT_HEROS)
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Note: if you change the size/type of any of the fields below,
|
||||||
|
* or add any/remove any fields, you must update the
|
||||||
|
* bwrite() calls in save_regions(), and the
|
||||||
|
* mread() calls in rest_regions() in src/region.c
|
||||||
|
* to reflect the changes.
|
||||||
|
*/
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
NhRect bounding_box; /* Bounding box of the region */
|
NhRect bounding_box; /* Bounding box of the region */
|
||||||
NhRect *rects; /* Rectangles composing the region */
|
NhRect *rects; /* Rectangles composing the region */
|
||||||
|
|||||||
+2
-2
@@ -646,7 +646,7 @@ int mode;
|
|||||||
bwrite(fd, (genericptr_t) ®ions[i]->can_leave_f, sizeof (short));
|
bwrite(fd, (genericptr_t) ®ions[i]->can_leave_f, sizeof (short));
|
||||||
bwrite(fd, (genericptr_t) ®ions[i]->leave_f, sizeof (short));
|
bwrite(fd, (genericptr_t) ®ions[i]->leave_f, sizeof (short));
|
||||||
bwrite(fd, (genericptr_t) ®ions[i]->inside_f, sizeof (short));
|
bwrite(fd, (genericptr_t) ®ions[i]->inside_f, sizeof (short));
|
||||||
bwrite(fd, (genericptr_t) ®ions[i]->player_flags, sizeof (boolean));
|
bwrite(fd, (genericptr_t) ®ions[i]->player_flags, sizeof (unsigned int));
|
||||||
bwrite(fd, (genericptr_t) ®ions[i]->n_monst, sizeof (short));
|
bwrite(fd, (genericptr_t) ®ions[i]->n_monst, sizeof (short));
|
||||||
for (j = 0; j < regions[i]->n_monst; j++)
|
for (j = 0; j < regions[i]->n_monst; j++)
|
||||||
bwrite(fd, (genericptr_t) ®ions[i]->monsters[j],
|
bwrite(fd, (genericptr_t) ®ions[i]->monsters[j],
|
||||||
@@ -721,7 +721,7 @@ boolean ghostly; /* If a bones file restore */
|
|||||||
mread(fd, (genericptr_t) ®ions[i]->can_leave_f, sizeof (short));
|
mread(fd, (genericptr_t) ®ions[i]->can_leave_f, sizeof (short));
|
||||||
mread(fd, (genericptr_t) ®ions[i]->leave_f, sizeof (short));
|
mread(fd, (genericptr_t) ®ions[i]->leave_f, sizeof (short));
|
||||||
mread(fd, (genericptr_t) ®ions[i]->inside_f, sizeof (short));
|
mread(fd, (genericptr_t) ®ions[i]->inside_f, sizeof (short));
|
||||||
mread(fd, (genericptr_t) ®ions[i]->player_flags, sizeof (boolean));
|
mread(fd, (genericptr_t) ®ions[i]->player_flags, sizeof (unsigned int));
|
||||||
if (ghostly) { /* settings pertained to old player */
|
if (ghostly) { /* settings pertained to old player */
|
||||||
clear_hero_inside(regions[i]);
|
clear_hero_inside(regions[i]);
|
||||||
clear_heros_fault(regions[i]);
|
clear_heros_fault(regions[i]);
|
||||||
|
|||||||
Reference in New Issue
Block a user