miniature is_mage get_mage optimization

This commit is contained in:
Enno Rehling 2017-10-06 22:38:01 +02:00
parent 6265abac74
commit 86e265c7c4
1 changed files with 6 additions and 5 deletions

View File

@ -1429,13 +1429,14 @@ 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) {
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;
}
}
}
return (int)(dk * mp);
}