summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--crawl-ref/source/debug.cc13
-rw-r--r--crawl-ref/source/monstuff.cc6
-rw-r--r--crawl-ref/source/mstuff2.cc11
-rw-r--r--crawl-ref/source/mstuff2.h2
4 files changed, 13 insertions, 19 deletions
diff --git a/crawl-ref/source/debug.cc b/crawl-ref/source/debug.cc
index 3315167307..4268ffbfaf 100644
--- a/crawl-ref/source/debug.cc
+++ b/crawl-ref/source/debug.cc
@@ -4104,19 +4104,16 @@ static void _move_monster(int x, int y, int mid1)
if (!moves.isValid || !in_bounds(moves.tx, moves.ty))
return;
- struct monsters* mon1 = &menv[mid1];
- if (mons_is_caught(mon1))
- mons_clear_trapping_net(mon1);
+ monsters* mon1 = &menv[mid1];
+ mons_clear_trapping_net(mon1);
- int mid2 = mgrd[moves.tx][moves.ty];
- struct monsters* mon2 = NULL;
+ int mid2 = mgrd[moves.tx][moves.ty];
+ monsters* mon2 = NULL;
if (mid2 != NON_MONSTER)
{
mon2 = &menv[mid2];
-
- if (mons_is_caught(mon2))
- mons_clear_trapping_net(mon2);
+ mons_clear_trapping_net(mon2);
}
mon1->x = moves.tx;
diff --git a/crawl-ref/source/monstuff.cc b/crawl-ref/source/monstuff.cc
index 350803d8ba..f0078313f5 100644
--- a/crawl-ref/source/monstuff.cc
+++ b/crawl-ref/source/monstuff.cc
@@ -703,8 +703,7 @@ void monster_die(monsters *monster, killer_type killer, int i, bool silent)
if (!silent && _monster_avoided_death(monster, killer, i))
return;
- if (mons_is_caught(monster))
- mons_clear_trapping_net(monster);
+ mons_clear_trapping_net(monster);
// Update list of monsters beholding player.
update_beholders(monster, true);
@@ -1645,8 +1644,7 @@ bool monster_blink(monsters *monster)
}
}
- if (mons_is_caught(monster))
- mons_clear_trapping_net(monster);
+ mons_clear_trapping_net(monster);
mgrd[monster->x][monster->y] = NON_MONSTER;
diff --git a/crawl-ref/source/mstuff2.cc b/crawl-ref/source/mstuff2.cc
index c3f9ae10a8..8e20b2dd09 100644
--- a/crawl-ref/source/mstuff2.cc
+++ b/crawl-ref/source/mstuff2.cc
@@ -996,8 +996,7 @@ void monster_teleport(struct monsters *monster, bool instan, bool silent)
// Pick the monster up.
mgrd(oldplace) = NON_MONSTER;
- if (mons_is_caught(monster))
- mons_clear_trapping_net(monster);
+ mons_clear_trapping_net(monster);
int newx, newy;
while (true)
@@ -2541,14 +2540,14 @@ bool moth_incite_monsters(const monsters *mon)
return (false);
}
-void mons_clear_trapping_net(monsters *mons)
+void mons_clear_trapping_net(monsters *mon)
{
- if (!mons_is_caught(mons))
+ if (!mons_is_caught(mon))
return;
- const int net = get_trapping_net(mons->x, mons->y);
+ const int net = get_trapping_net(mon->x, mon->y);
if (net != NON_ITEM)
remove_item_stationary(mitm[net]);
- mons->del_ench(ENCH_HELD, true);
+ mon->del_ench(ENCH_HELD, true);
}
diff --git a/crawl-ref/source/mstuff2.h b/crawl-ref/source/mstuff2.h
index 1feec60af6..7d7512ad66 100644
--- a/crawl-ref/source/mstuff2.h
+++ b/crawl-ref/source/mstuff2.h
@@ -99,6 +99,6 @@ bool orc_battle_cry(monsters *chief);
bool orange_statue_effects(monsters *mons);
bool silver_statue_effects(monsters *mons);
bool moth_incite_monsters(const monsters *mon);
-void mons_clear_trapping_net(monsters *mons);
+void mons_clear_trapping_net(monsters *mon);
#endif