Opened 6 years ago

Closed 6 years ago

#1751 closed bug (fixed (in master))

cavern_gen not providing permanent walls, I think?

Reported by: seebs Owned by:
Milestone: Triage Keywords:
Cc:

Description

So, I have a save in which I can crash out with an assertion failure for cave_in_bounds. On looking, it appears that cavern_gen, unlike labyrinth_gen and default_gen, never draws permanent walls around the level, and I think that may be the root of the problem.

Attachments (1)

Speedy (97.1 KB) - added by seebs 6 years ago.
Save file on a level which easily crashes (just dig around near an edge and use x to look around).

Download all attachments as: .zip

Change History (5)

Changed 6 years ago by seebs

Save file on a level which easily crashes (just dig around near an edge and use x to look around).

comment:1 Changed 6 years ago by seebs

Okay, this was sort of a red herring (although we probably do want that).

Issue #1: cavern_gen does set_cave_dimensions(c, h, w) where it probably means (c, h + 2, w + 2).
Issue #2: No permanent walls.
Issue #3: target_set_interactive is using:

int dungeon_hgt = (p_ptr->depth == 0) ? TOWN_HGT : DUNGEON_HGT;

and that's just plain wrong.

comment:2 Changed 6 years ago by PowerWyrm

I already reported this problem on the forums. In init_cavern(), instead of:

draw_rectangle(c, 0, 0, DUNGEON_HGT - 1, DUNGEON_WID - 1, FEAT_PERM_SOLID);
fill_rectangle(c, 1, 1, DUNGEON_HGT - 2, DUNGEON_WID - 2, FEAT_WALL_SOLID);

it should be:

fill_rectangle(c, 0, 0, DUNGEON_HGT - 1, DUNGEON_WID - 1, FEAT_PERM_SOLID);
fill_rectangle(c, 1, 1, h - 2, w - 2, FEAT_WALL_SOLID);

And yes, target_set_interactive should use cave height/width instead of DUNGEON_HGT/DUNGEON_WID, otherwise the game crashes when you try to manually target a spot outside cave dimensions.

comment:3 Changed 6 years ago by takkaria

Fixed in master. Thanks for the patch.

comment:4 Changed 6 years ago by takkaria

  • Resolution set to fixed (in master)
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.