B14001 - Stinking clouds in bonesfiles
Incorporate a fix from <Someone> that resets the timestamp on stinking clouds left in bones files. This does allow the cloud's ttl to restart. Extended it to reset the player_inside flag. Then noticed that the only placed that called in_out_region was domove(). Added calls when changing levels (which causes player_inside to be set correctly if the cloud covers the location where the player starts on the bones level), teleporting, and inside hurtle_step. There are still other places that fail to call in_out_region, which others may choose to tackle. I split out the remaining stinking cloud bug reported in the same e-mail into a separate betabug. That one probably cannot be addressed without changing the level file format to track the creator.
This commit is contained in:
@@ -281,6 +281,8 @@ destroy traps that are buried by boulders dropped in water
|
||||
renamed debug commands: light sources -> lightsources,
|
||||
monpoly_control -> monpolycontrol
|
||||
detect attempt to swap places with big pet through narrow opening
|
||||
stinking clouds in bones files do not get their ttl set reasonably
|
||||
stinking clouds in bones files may incorrectly set player_inside
|
||||
|
||||
|
||||
Platform- and/or Interface-Specific Fixes
|
||||
|
||||
@@ -1638,7 +1638,7 @@ E void FDECL(update_monster_region, (struct monst *));
|
||||
E NhRegion *FDECL(visible_region_at, (XCHAR_P,XCHAR_P));
|
||||
E void FDECL(show_region, (NhRegion*, XCHAR_P, XCHAR_P));
|
||||
E void FDECL(save_regions, (int,int));
|
||||
E void FDECL(rest_regions, (int));
|
||||
E void FDECL(rest_regions, (int,BOOLEAN_P));
|
||||
E NhRegion* FDECL(create_gas_cloud, (XCHAR_P, XCHAR_P, int, int));
|
||||
|
||||
/* ### restore.c ### */
|
||||
|
||||
2
src/do.c
2
src/do.c
@@ -1317,6 +1317,8 @@ boolean at_stairs, falling, portal;
|
||||
save_currentstate();
|
||||
#endif
|
||||
|
||||
/* assume this will always return TRUE when changing level */
|
||||
(void) in_out_region(u.ux, u.uy);
|
||||
(void) pickup(1);
|
||||
}
|
||||
|
||||
|
||||
@@ -437,6 +437,8 @@ hurtle_step(arg, x, y)
|
||||
if (!isok(x,y)) {
|
||||
You_feel("the spirits holding you back.");
|
||||
return FALSE;
|
||||
} else if (!in_out_region(x, y)) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (!Passes_walls || !(may_pass = may_passwall(x, y))) {
|
||||
|
||||
@@ -657,8 +657,9 @@ skip_lots:
|
||||
}
|
||||
|
||||
void
|
||||
rest_regions(fd)
|
||||
rest_regions(fd, ghostly)
|
||||
int fd;
|
||||
boolean ghostly; /* If a bones file restore */
|
||||
{
|
||||
int i, j;
|
||||
unsigned n;
|
||||
@@ -667,7 +668,8 @@ int fd;
|
||||
|
||||
clear_regions(); /* Just for security */
|
||||
mread(fd, (genericptr_t) &tmstamp, sizeof (tmstamp));
|
||||
tmstamp = (moves - tmstamp);
|
||||
if (ghostly) tmstamp = 0;
|
||||
else tmstamp = (moves - tmstamp);
|
||||
mread(fd, (genericptr_t) &n_regions, sizeof (n_regions));
|
||||
max_regions = n_regions;
|
||||
if (n_regions > 0)
|
||||
@@ -715,6 +717,7 @@ int fd;
|
||||
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]->player_inside, sizeof (boolean));
|
||||
if (ghostly) regions[i]->player_inside = FALSE; /* old player */
|
||||
mread(fd, (genericptr_t) ®ions[i]->n_monst, sizeof (short));
|
||||
if (regions[i]->n_monst > 0)
|
||||
regions[i]->monsters =
|
||||
|
||||
@@ -839,7 +839,7 @@ boolean ghostly;
|
||||
}
|
||||
restdamage(fd, ghostly);
|
||||
|
||||
rest_regions(fd);
|
||||
rest_regions(fd, ghostly);
|
||||
if (ghostly) {
|
||||
/* Now get rid of all the temp fruits... */
|
||||
freefruitchn(oldfruit), oldfruit = 0;
|
||||
|
||||
@@ -207,6 +207,7 @@ boolean trapok;
|
||||
if (!trapok && t_at(x, y)) return FALSE;
|
||||
if (!goodpos(x, y, &youmonst)) return FALSE;
|
||||
if (!tele_jump_ok(u.ux, u.uy, x, y)) return FALSE;
|
||||
if (!in_out_region(x, y)) return FALSE;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user