Several things that break savefile compatibility
- Version change from 3.4.x - timed_delay feature ignore in makedefs - several flags from iflags to flags - use offsets from mons array entries in save file rather than storing the ptr and calculating the distance from beginning of array
This commit is contained in:
@@ -413,7 +413,7 @@ moveloop()
|
||||
|
||||
if (vision_full_recalc) vision_recalc(0); /* vision! */
|
||||
/* when running in non-tport mode, this gets done through domove() */
|
||||
if ((!flags.run || iflags.runmode == RUN_TPORT) &&
|
||||
if ((!flags.run || flags.runmode == RUN_TPORT) &&
|
||||
(multi && (!flags.travel ? !(multi % 7) : !(moves % 7L)))) {
|
||||
if (flags.time && flags.run) flags.botl = 1;
|
||||
display_nhwindow(WIN_MAP, FALSE);
|
||||
|
||||
@@ -1840,7 +1840,7 @@ register char *cmd;
|
||||
multi = 0;
|
||||
return;
|
||||
case CMD_TRAVEL:
|
||||
if (iflags.travelcmd) {
|
||||
if (flags.travelcmd) {
|
||||
flags.travel = 1;
|
||||
flags.run = 8;
|
||||
flags.nopick = 1;
|
||||
@@ -2156,7 +2156,7 @@ click_to_cmd(x, y, mod)
|
||||
x -= u.ux;
|
||||
y -= u.uy;
|
||||
|
||||
if (iflags.travelcmd) {
|
||||
if (flags.travelcmd) {
|
||||
if (abs(x) <= 1 && abs(y) <= 1 ) {
|
||||
x = sgn(x), y = sgn(y);
|
||||
} else {
|
||||
@@ -2382,7 +2382,7 @@ dotravel()
|
||||
static char cmd[2];
|
||||
coord cc;
|
||||
|
||||
if (!iflags.travelcmd) return 0;
|
||||
if (!flags.travelcmd) return 0;
|
||||
cmd[1]=0;
|
||||
cc.x = u.ux;
|
||||
cc.y = u.uy;
|
||||
|
||||
@@ -1377,13 +1377,13 @@ domove()
|
||||
nomovemsg = "";
|
||||
}
|
||||
|
||||
if (flags.run && iflags.runmode != RUN_TPORT) {
|
||||
if (flags.run && flags.runmode != RUN_TPORT) {
|
||||
/* display every step or every 7th step depending upon mode */
|
||||
if (iflags.runmode != RUN_LEAP || !(moves % 7L)) {
|
||||
if (flags.runmode != RUN_LEAP || !(moves % 7L)) {
|
||||
if (flags.time) flags.botl = 1;
|
||||
curs_on_u();
|
||||
delay_output();
|
||||
if (iflags.runmode == RUN_CRAWL) {
|
||||
if (flags.runmode == RUN_CRAWL) {
|
||||
delay_output();
|
||||
delay_output();
|
||||
delay_output();
|
||||
|
||||
@@ -202,7 +202,7 @@ unsigned *ospecial;
|
||||
/* special case the hero for `showrace' option */
|
||||
#ifdef TEXTCOLOR
|
||||
if (iflags.use_color && x == u.ux && y == u.uy &&
|
||||
iflags.showrace && !Upolyd)
|
||||
flags.showrace && !Upolyd)
|
||||
color = HI_DOMESTIC;
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -113,7 +113,7 @@ static struct Bool_Opt
|
||||
{"large_font", &iflags.obsolete, FALSE, SET_IN_FILE}, /* OBSOLETE */
|
||||
{"legacy", &flags.legacy, TRUE, DISP_IN_GAME},
|
||||
{"lit_corridor", &flags.lit_corridor, FALSE, SET_IN_GAME},
|
||||
{"lootabc", &iflags.lootabc, FALSE, SET_IN_GAME},
|
||||
{"lootabc", &flags.lootabc, FALSE, SET_IN_GAME},
|
||||
#ifdef MAC_GRAPHICS_ENV
|
||||
{"Macgraphics", &iflags.MACgraphics, TRUE, SET_IN_GAME},
|
||||
#else
|
||||
@@ -165,7 +165,7 @@ static struct Bool_Opt
|
||||
#else
|
||||
{"showexp", (boolean *)0, FALSE, SET_IN_FILE},
|
||||
#endif
|
||||
{"showrace", &iflags.showrace, FALSE, SET_IN_GAME},
|
||||
{"showrace", &flags.showrace, FALSE, SET_IN_GAME},
|
||||
#ifdef SCORE_ON_BOTL
|
||||
{"showscore", &flags.showscore, FALSE, SET_IN_GAME},
|
||||
#else
|
||||
@@ -186,7 +186,7 @@ static struct Bool_Opt
|
||||
#endif
|
||||
{"tombstone",&flags.tombstone, TRUE, SET_IN_GAME},
|
||||
{"toptenwin",&flags.toptenwin, FALSE, SET_IN_GAME},
|
||||
{"travel", &iflags.travelcmd, TRUE, SET_IN_GAME},
|
||||
{"travel", &flags.travelcmd, TRUE, SET_IN_GAME},
|
||||
{"use_inverse", &iflags.wc_inverse, FALSE, SET_IN_GAME}, /*WC*/
|
||||
{"verbose", &flags.verbose, TRUE, SET_IN_GAME},
|
||||
{(char *)0, (boolean *)0, FALSE, 0}
|
||||
@@ -489,7 +489,7 @@ initoptions()
|
||||
flags.end_own = FALSE;
|
||||
flags.end_top = 3;
|
||||
flags.end_around = 2;
|
||||
iflags.runmode = RUN_LEAP;
|
||||
flags.runmode = RUN_LEAP;
|
||||
iflags.msg_history = 20;
|
||||
#ifdef TTY_GRAPHICS
|
||||
iflags.prevmsg_window = 's';
|
||||
@@ -1069,16 +1069,16 @@ boolean tinitial, tfrom_file;
|
||||
fullname = "runmode";
|
||||
if (match_optname(opts, fullname, 4, TRUE)) {
|
||||
if (negated) {
|
||||
iflags.runmode = RUN_TPORT;
|
||||
flags.runmode = RUN_TPORT;
|
||||
} else if ((op = string_for_opt(opts, FALSE)) != 0) {
|
||||
if (!strncmpi(op, "teleport", strlen(op)))
|
||||
iflags.runmode = RUN_TPORT;
|
||||
flags.runmode = RUN_TPORT;
|
||||
else if (!strncmpi(op, "run", strlen(op)))
|
||||
iflags.runmode = RUN_LEAP;
|
||||
flags.runmode = RUN_LEAP;
|
||||
else if (!strncmpi(op, "walk", strlen(op)))
|
||||
iflags.runmode = RUN_STEP;
|
||||
flags.runmode = RUN_STEP;
|
||||
else if (!strncmpi(op, "crawl", strlen(op)))
|
||||
iflags.runmode = RUN_CRAWL;
|
||||
flags.runmode = RUN_CRAWL;
|
||||
else
|
||||
badoption(opts);
|
||||
}
|
||||
@@ -2133,7 +2133,7 @@ goodfruit:
|
||||
vision_full_recalc = 1; /* delayed recalc */
|
||||
}
|
||||
else if ((boolopt[i].addr) == &iflags.use_inverse ||
|
||||
(boolopt[i].addr) == &iflags.showrace ||
|
||||
(boolopt[i].addr) == &flags.showrace ||
|
||||
(boolopt[i].addr) == &iflags.hilite_pet) {
|
||||
need_redraw = TRUE;
|
||||
}
|
||||
@@ -2550,7 +2550,7 @@ boolean setinitial,setfromfile;
|
||||
}
|
||||
end_menu(tmpwin, "Select run/travel display mode:");
|
||||
if (select_menu(tmpwin, PICK_ONE, &mode_pick) > 0) {
|
||||
iflags.runmode = mode_pick->item.a_int - 1;
|
||||
flags.runmode = mode_pick->item.a_int - 1;
|
||||
free((genericptr_t)mode_pick);
|
||||
}
|
||||
destroy_nhwindow(tmpwin);
|
||||
@@ -2783,7 +2783,7 @@ char *buf;
|
||||
else if (!strcmp(optname, "role"))
|
||||
Sprintf(buf, "%s", rolestring(flags.initrole, roles, name.m));
|
||||
else if (!strcmp(optname, "runmode"))
|
||||
Sprintf(buf, "%s", runmodes[iflags.runmode]);
|
||||
Sprintf(buf, "%s", runmodes[flags.runmode]);
|
||||
else if (!strcmp(optname, "scores")) {
|
||||
Sprintf(buf, "%d top/%d around%s", flags.end_top,
|
||||
flags.end_around, flags.end_own ? "/own" : "");
|
||||
|
||||
@@ -577,7 +577,7 @@ do_look(quick)
|
||||
symbol; firstmatch is assumed to already be set for '@' */
|
||||
if ((from_screen ?
|
||||
(sym == monsyms[S_HUMAN] && cc.x == u.ux && cc.y == u.uy) :
|
||||
(sym == def_monsyms[S_HUMAN] && !iflags.showrace)) &&
|
||||
(sym == def_monsyms[S_HUMAN] && !flags.showrace)) &&
|
||||
!(Race_if(PM_HUMAN) || Race_if(PM_ELF)) && !Upolyd)
|
||||
found += append_str(out_str, "you"); /* tack on "or you" */
|
||||
|
||||
|
||||
@@ -2259,7 +2259,7 @@ boolean outokay, inokay;
|
||||
menu_item *pick_list;
|
||||
char buf[BUFSZ];
|
||||
int n;
|
||||
const char *menuselector = iflags.lootabc ? "abc" : "oib";
|
||||
const char *menuselector = flags.lootabc ? "abc" : "oib";
|
||||
|
||||
any.a_void = 0;
|
||||
win = create_nhwindow(NHW_MENU);
|
||||
|
||||
@@ -251,13 +251,7 @@ boolean ghostly;
|
||||
{
|
||||
register struct monst *mtmp, *mtmp2 = 0;
|
||||
register struct monst *first = (struct monst *)0;
|
||||
int xl;
|
||||
struct permonst *monbegin;
|
||||
boolean moved;
|
||||
|
||||
/* get the original base address */
|
||||
mread(fd, (genericptr_t)&monbegin, sizeof(monbegin));
|
||||
moved = (monbegin != mons);
|
||||
int xl, offset;
|
||||
|
||||
while(1) {
|
||||
mread(fd, (genericptr_t) &xl, sizeof(xl));
|
||||
@@ -271,10 +265,8 @@ boolean ghostly;
|
||||
add_id_mapping(mtmp->m_id, nid);
|
||||
mtmp->m_id = nid;
|
||||
}
|
||||
if (moved && mtmp->data) {
|
||||
int offset = mtmp->data - monbegin; /*(ptrdiff_t)*/
|
||||
mtmp->data = mons + offset; /* new permonst location */
|
||||
}
|
||||
offset = mtmp->mnum;
|
||||
mtmp->data = &mons[offset];
|
||||
if(mtmp->minvent) {
|
||||
struct obj *obj;
|
||||
mtmp->minvent = restobjchn(fd, ghostly, FALSE);
|
||||
|
||||
@@ -274,7 +274,6 @@ savegamestate(fd, mode)
|
||||
register int fd, mode;
|
||||
{
|
||||
int uid;
|
||||
|
||||
#ifdef MFLOPPY
|
||||
count_only = (mode & COUNT_SAVE);
|
||||
#endif
|
||||
@@ -875,14 +874,11 @@ register struct monst *mtmp;
|
||||
register struct monst *mtmp2;
|
||||
unsigned int xl;
|
||||
int minusone = -1;
|
||||
struct permonst *monbegin = &mons[0];
|
||||
|
||||
if (perform_bwrite(mode))
|
||||
bwrite(fd, (genericptr_t) &monbegin, sizeof(monbegin));
|
||||
|
||||
while (mtmp) {
|
||||
mtmp2 = mtmp->nmon;
|
||||
if (perform_bwrite(mode)) {
|
||||
mtmp->mnum = monsndx(mtmp->data);
|
||||
xl = mtmp->mxlth + mtmp->mnamelth;
|
||||
bwrite(fd, (genericptr_t) &xl, sizeof(int));
|
||||
bwrite(fd, (genericptr_t) mtmp, xl + sizeof(struct monst));
|
||||
|
||||
Reference in New Issue
Block a user