{
g_ptr->info &= ~CAVE_TRAP;
g_ptr->mimic = g_ptr->feat;
- g_ptr->feat = choose_random_trap();
+ g_ptr->feat = choose_random_trap(floor_ptr);
}
/* Another hidden trap */
* Actually, it is not this routine, but the "trap instantiation"\n
* code, which should also check for "trap doors" on quest levels.\n
*/
-FEAT_IDX choose_random_trap(void)
+FEAT_IDX choose_random_trap(floor_type *floor_ptr)
{
FEAT_IDX feat;
if (!have_flag(f_info[feat].flags, FF_MORE)) break;
/* Hack -- no trap doors on special levels */
- if (p_ptr->current_floor_ptr->inside_arena || quest_number(p_ptr->current_floor_ptr->dun_level)) continue;
+ if (floor_ptr->inside_arena || quest_number(floor_ptr->dun_level)) continue;
/* Hack -- no trap doors on the deepest level */
- if (p_ptr->current_floor_ptr->dun_level >= d_info[p_ptr->dungeon_idx].maxdepth) continue;
+ if (floor_ptr->dun_level >= d_info[floor_ptr->dungeon_idx].maxdepth) continue;
break;
}
/* Place an invisible trap */
g_ptr->mimic = g_ptr->feat;
- g_ptr->feat = choose_random_trap();
+ g_ptr->feat = choose_random_trap(floor_ptr);
}
extern void init_normal_traps(void);
-extern FEAT_IDX choose_random_trap(void);
+extern FEAT_IDX choose_random_trap(floor_type *floor_ptr);
extern void disclose_grid(POSITION y, POSITION x);
extern void place_trap(floor_type *floor_ptr, POSITION y, POSITION x);
extern void hit_trap(player_type *trapped_ptr, bool break_trap);