diff --git a/src/kernel/config.c b/src/kernel/config.c index d298f77d7..eb5c9064b 100644 --- a/src/kernel/config.c +++ b/src/kernel/config.c @@ -530,7 +530,7 @@ int alliedunit(const unit * u, const faction * f2, int mode) ally *sf; int automode; - assert(u->region); /* the unit should be in a region, but it's possible that u->number==0 (TEMP units) */ + assert(u && u->region); /* the unit should be in a region, but it's possible that u->number==0 (TEMP units) */ if (u->faction == f2) return mode; if (u->faction != NULL && f2 != NULL) { diff --git a/src/kernel/unit.c b/src/kernel/unit.c index 6a0e22f08..a43ae2153 100644 --- a/src/kernel/unit.c +++ b/src/kernel/unit.c @@ -1281,7 +1281,7 @@ static int update_gbdream(const unit * u, int bonus, curse *c, const curse_type /* wir suchen jeweils den groessten Bonus und den groestsen Malus */ if (sign * effect > sign * bonus) { if (mage == NULL || mage->number == 0 - || sign>0?alliedunit(mage, u->faction, HELP_GUARD):!alliedunit(mage, u->faction, HELP_GUARD)) { + || (sign>0?alliedunit(mage, u->faction, HELP_GUARD):!alliedunit(mage, u->faction, HELP_GUARD))) { bonus = (int)effect; } }