From 86e265c7c48aaeab0d653cfc131acc321177d2de Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Fri, 6 Oct 2017 22:38:01 +0200 Subject: [PATCH] miniature is_mage get_mage optimization --- src/move.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/move.c b/src/move.c index 46a8f200f..3f899ac22 100644 --- a/src/move.c +++ b/src/move.c @@ -1429,11 +1429,12 @@ int movement_speed(const unit * u) /* Im Astralraum sind Tyb und Ill-Magier doppelt so schnell. * Nicht kumulativ mit anderen Beschleunigungen! */ - if (mp * dk <= BP_WALKING * u_race(u)->speed && is_astral(u->region) - && is_mage(u)) { - sc_mage *mage = get_mage_depr(u); - if (mage->magietyp == M_TYBIED || mage->magietyp == M_ILLAUN) { - mp *= 2; + if (mp * dk <= BP_WALKING * u_race(u)->speed && is_astral(u->region)) { + sc_mage *mage = get_mage(u); + if (mage && (mage->magietyp == M_TYBIED || mage->magietyp == M_ILLAUN)) { + if (has_skill(u, SK_MAGIC)) { + mp *= 2; + } } }