summaryrefslogtreecommitdiff
path: root/src/traps.cc
diff options
context:
space:
mode:
authorBardur Arantsson <bardur@scientician.net>2016-10-05 18:45:08 +0200
committerBardur Arantsson <bardur@scientician.net>2016-10-05 18:49:37 +0200
commit0c2f30b56c221a826ba64f0ec864c29d0f717644 (patch)
treea7b38e7b9cf9a06aacd56ec8a7177d44d001c1df /src/traps.cc
parent5ddcbbf1cdce68e565376819efedd519892512ad (diff)
Move r_info into GameEditData
Diffstat (limited to 'src/traps.cc')
-rw-r--r--src/traps.cc12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/traps.cc b/src/traps.cc
index 067934b9..0f6c1f5d 100644
--- a/src/traps.cc
+++ b/src/traps.cc
@@ -2353,6 +2353,8 @@ bool_ mon_hit_trap_aux_staff(int m_idx, object_type *o_ptr)
*/
bool_ mon_hit_trap_aux_scroll(int m_idx, int sval)
{
+ auto const &r_info = game->edit_data.r_info;
+
monster_type *m_ptr = &m_list[m_idx];
int dam = 0, typ = 0;
int rad = 0;
@@ -2448,7 +2450,7 @@ bool_ mon_hit_trap_aux_scroll(int m_idx, int sval)
break;
case SV_SCROLL_GENOCIDE:
{
- monster_race *r_ptr = &r_info[m_ptr->r_idx];
+ auto r_ptr = &r_info[m_ptr->r_idx];
genocide_aux(FALSE, r_ptr->d_char);
/* although there's no point in a multiple genocide trap... */
return (!(r_ptr->flags & RF_UNIQUE));
@@ -2490,6 +2492,8 @@ bool_ mon_hit_trap_aux_wand(int m_idx, object_type *o_ptr)
*/
bool_ mon_hit_trap_aux_potion(int m_idx, object_type *o_ptr)
{
+ auto const &r_info = game->edit_data.r_info;
+
monster_type *m_ptr = &m_list[m_idx];
int dam = 0, typ = 0;
int y = m_ptr->fy;
@@ -2613,7 +2617,7 @@ bool_ mon_hit_trap_aux_potion(int m_idx, object_type *o_ptr)
break;
case SV_POTION_LIFE:
{
- monster_race *r_ptr = &r_info[m_ptr->r_idx];
+ auto r_ptr = &r_info[m_ptr->r_idx];
if (r_ptr->flags & RF_UNDEAD)
{
typ = GF_HOLY_FIRE;
@@ -2645,8 +2649,10 @@ bool_ mon_hit_trap_aux_potion(int m_idx, object_type *o_ptr)
*/
bool_ mon_hit_trap(int m_idx)
{
+ auto const &r_info = game->edit_data.r_info;
+
monster_type *m_ptr = &m_list[m_idx];
- monster_race *r_ptr = &r_info[m_ptr->r_idx];
+ auto r_ptr = &r_info[m_ptr->r_idx];
object_type object_type_body;