parentheses to fix operator precedence.

This commit is contained in:
Enno Rehling 2015-07-03 16:13:24 +02:00
parent b2d981e577
commit 59745c7ed0
2 changed files with 2 additions and 2 deletions

View File

@ -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) {

View File

@ -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;
}
}