Fix description of OT_TREEDOWN

If you visit a new branch before taking the regular stairs in your current branch  DON'T update nextmap[dir] to point at the new branch.
This commit is contained in:
rob 2022-08-30 20:19:48 +10:00
parent 6199c829bb
commit 072cc96e4f
2 changed files with 13 additions and 6 deletions

2
data.c
View File

@ -2398,7 +2398,7 @@ void initobjects(void) {
addflag(lastot->flags, F_ONEPERCELL, B_TRUE, NA, NA, NULL);
addflag(lastot->flags, F_IMPORTANT, B_TRUE, NA, NA, NULL);
addot(OT_TREEDOWN, "hollow tree leading down", "A huge hollow tree containing an ascending staircase.", MT_DRAGONWOOD, 3000, OC_DFEATURE, SZ_HUGE);
addot(OT_TREEDOWN, "hollow tree leading down", "A huge hollow tree containing a descending staircase.", MT_DRAGONWOOD, 3000, OC_DFEATURE, SZ_HUGE);
addflag(lastot->flags, F_GLYPH, C_WOOD, '>', NA, NULL);
addflag(lastot->flags, F_STAIRS, B_TRUE, NA, NA, NULL);
addflag(lastot->flags, F_CLIMBABLE, D_DOWN, NA, NA, "hollow tree");

17
map.c
View File

@ -4717,14 +4717,21 @@ void createmap(map_t *map, int depth, region_t *region, map_t *parentmap, int ex
//if (gamemode == GM_GAMESTARTED) checkallflags(player->cell->map); // debugging
// did we come from a previous map in the same region?
if (parentmap && (exitdir != D_NONE)) {
if ((parentmap->region->id == map->region->id) ||
(map->region->rtype->majorbranch)) {
if (db) dblog(" linking to parentmap %s in dir %s", parentmap->name, getdirname(diropposite(exitdir)));
if (parentmap->region->id == map->region->id) {
// we came from a previous map in the same region
if (db) dblog(" linking to same region parentmap %s in dir %s", parentmap->name, getdirname(diropposite(exitdir)));
// ONLY change parent map's nextmap if it's
// in the same region.
parentmap->nextmap[exitdir] = map->id;
assert(exitdir >= 0);
map->nextmap[diropposite(exitdir)] = parentmap->id;
} else if (map->region->rtype->majorbranch) {
// we just arrived at the first map of a new region
if (db) dblog(" linking to diff region parentmap %s in dir %s", parentmap->name, getdirname(diropposite(exitdir)));
map->nextmap[diropposite(exitdir)] = parentmap->id;
// don't update parent map's nextmap[] since we
// want it to go to maps of the parent's
// region.
}
}
//if (gamemode == GM_GAMESTARTED) checkallflags(player->cell->map); // debugging