From a7cf1b9a69b32a88047c3e9fb93bc02a9ca5840d Mon Sep 17 00:00:00 2001 From: David Lawrence Ramsey Date: Wed, 18 Nov 2009 12:34:35 -0600 Subject: Clean up rotting resistance checks, as they're effectively boolean. --- crawl-ref/source/monster.cc | 2 +- crawl-ref/source/player.cc | 8 ++++---- crawl-ref/source/spl-mis.cc | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/crawl-ref/source/monster.cc b/crawl-ref/source/monster.cc index 92b1fe91cf..0d6e8d0fe2 100644 --- a/crawl-ref/source/monster.cc +++ b/crawl-ref/source/monster.cc @@ -3464,7 +3464,7 @@ bool monsters::drain_exp(actor *agent, bool quiet, int pow) bool monsters::rot(actor *agent, int amount, int immediate, bool quiet) { - if (res_rotting() > 0 || amount <= 0) + if (res_rotting() || amount <= 0) return (false); if (!quiet && you.can_see(this)) diff --git a/crawl-ref/source/player.cc b/crawl-ref/source/player.cc index be27606499..0900f1bae6 100644 --- a/crawl-ref/source/player.cc +++ b/crawl-ref/source/player.cc @@ -6441,8 +6441,8 @@ int player::res_poison() const int player::res_rotting() const { - if (this->is_undead - && (this->is_undead != US_SEMI_UNDEAD || this->hunger_state < HS_SATIATED)) + if (is_undead + && (is_undead != US_SEMI_UNDEAD || hunger_state < HS_SATIATED)) { return (1); } @@ -6683,7 +6683,7 @@ bool player::rot(actor *who, int amount, int immediate, bool quiet) if (amount <= 0) return (false); - if (this->res_rotting()) + if (res_rotting()) { mpr("You feel terrible."); return (false); @@ -6802,7 +6802,7 @@ bool player::sicken(int amount) { ASSERT(!crawl_state.arena); - if (this->res_rotting() || amount <= 0) + if (res_rotting() || amount <= 0) return (false); mpr( "You feel ill." ); diff --git a/crawl-ref/source/spl-mis.cc b/crawl-ref/source/spl-mis.cc index bfe11d25b6..8666fa8fa1 100644 --- a/crawl-ref/source/spl-mis.cc +++ b/crawl-ref/source/spl-mis.cc @@ -1652,7 +1652,7 @@ void MiscastEffect::_necromancy(int severity) _potion_effect(POT_SLOWING, 15); break; case 2: - if (target->res_rotting() == 0) + if (!target->res_rotting()) { if (you.can_smell()) { -- cgit v1.2.3-54-g00ecf