* on the level on which the chest is generated.
* </pre>
*/
-void chest_death(bool scatter, POSITION y, POSITION x, OBJECT_IDX o_idx)
+void chest_death(player_type *owner_ptr, bool scatter, POSITION y, POSITION x, OBJECT_IDX o_idx)
{
int number;
object_type forge;
object_type *q_ptr;
- object_type *o_ptr = &p_ptr->current_floor_ptr->o_list[o_idx];
+ object_type *o_ptr = &owner_ptr->current_floor_ptr->o_list[o_idx];
/* Small chests often hold "gold" */
number = 5;
small = FALSE;
mode |= AM_GREAT;
- p_ptr->current_floor_ptr->object_level = o_ptr->xtra3;
+ owner_ptr->current_floor_ptr->object_level = o_ptr->xtra3;
}
else
{
/* Determine the "value" of the items */
- p_ptr->current_floor_ptr->object_level = ABS(o_ptr->pval) + 10;
+ owner_ptr->current_floor_ptr->object_level = ABS(o_ptr->pval) + 10;
}
/* Zero pval means empty chest */
x = randint0(MAX_WID);
/* Must be an empty floor. */
- if (!cave_empty_bold(p_ptr->current_floor_ptr, y, x)) continue;
+ if (!cave_empty_bold(owner_ptr->current_floor_ptr, y, x)) continue;
/* Place the object there. */
(void)drop_near(q_ptr, -1, y, x);
}
/* Reset the object level */
- p_ptr->current_floor_ptr->object_level = p_ptr->current_floor_ptr->base_level;
+ owner_ptr->current_floor_ptr->object_level = owner_ptr->current_floor_ptr->base_level;
/* Empty */
o_ptr->pval = 0;
if ((trap & (CHEST_SCATTER)) && o_ptr->k_idx)
{
msg_print(_("宝箱の中身はダンジョンじゅうに散乱した!", "The contents of the chest scatter all over the dungeon!"));
- chest_death(TRUE, y, x, o_idx);
+ chest_death(target_ptr, TRUE, y, x, o_idx);
o_ptr->pval = 0;
}
}
-extern void chest_death(bool scatter, POSITION y, POSITION x, OBJECT_IDX o_idx);
+extern void chest_death(player_type *owner_ptr, bool scatter, POSITION y, POSITION x, OBJECT_IDX o_idx);
extern void chest_trap(player_type *target_ptr, POSITION y, POSITION x, OBJECT_IDX o_idx);
chest_trap(creature_ptr, y, x, o_idx);
/* Let the Chest drop items */
- chest_death(FALSE, y, x, o_idx);
+ chest_death(creature_ptr, FALSE, y, x, o_idx);
}
return (more);
}