null-pointer check neuer rüstungscode.

This commit is contained in:
Enno Rehling 2005-07-31 07:42:13 +00:00
parent 04ac02ebd9
commit e4d264681d

View file

@ -965,8 +965,8 @@ terminate(troop dt, troop at, int type, const char *damage, boolean missile)
sd = weapon_effskill(dt, at, weapon, false, false); sd = weapon_effskill(dt, at, weapon, false, false);
if (weapon!=NULL) dwtype=weapon->type; if (weapon!=NULL) dwtype=weapon->type;
ar = armor->prot; if (armor) ar = armor->prot;
ar += shield->prot; if (shield) ar += shield->prot;
/* natürliche Rüstung */ /* natürliche Rüstung */
an = du->race->armor; an = du->race->armor;
@ -1054,8 +1054,8 @@ terminate(troop dt, troop at, int type, const char *damage, boolean missile)
if (dwp == WP_RUNESWORD) res -= 0.80; if (dwp == WP_RUNESWORD) res -= 0.80;
#endif #endif
/* der Effekt von Laen steigt nicht linear */ /* der Effekt von Laen steigt nicht linear */
if (fval(armor, ATF_LAEN)) res *= (1-armor->magres); if (armor && fval(armor, ATF_LAEN)) res *= (1-armor->magres);
if (fval(shield, ATF_LAEN)) res *= (1-shield->magres); if (shield && fval(shield, ATF_LAEN)) res *= (1-shield->magres);
if (dwtype) res *= (1-dwtype->magres); if (dwtype) res *= (1-dwtype->magres);
} }