--- deliantra/server/common/living.C 2008/05/02 20:16:24 1.83 +++ deliantra/server/common/living.C 2008/05/02 20:24:48 1.84 @@ -281,10 +281,12 @@ int change_abil (object *op, object *tmp) { - int flag = QUERY_FLAG (tmp, FLAG_APPLIED) ? 1 : -1, success = 0; + int flag = tmp->flag [FLAG_APPLIED] ? 1 : -1; + int success = 0; char message[MAX_BUF]; int potion_max = 0; + // keep some stats for comparison purposes object::flags_t prev_flag = op->flag; MoveType prev_move_type = op->move_type; sint16 prev_resist [NROFATTACKS]; // clumsy @@ -296,6 +298,7 @@ if (tmp->type == POTION) { potion_max = 1; + for (int j = 0; j < NUM_STATS; j++) { int ostat = op->contr->orig_stats.stat (j); @@ -304,8 +307,7 @@ /* nstat is what the stat will be after use of the potion */ int nstat = flag * i + ostat; - /* Do some bounds checking. While I don't think any - * potions do so right now, there is the potential for potions + /* Do some bounds checking. There is the potential for potions * that adjust that stat by more than one point, so we need * to allow for that. */ @@ -568,16 +570,12 @@ } if (!potion_max) - { - for (int j = 0; j < NUM_STATS; j++) + for (int j = 0; j < NUM_STATS; j++) + if (int i = tmp->stats.stat (j)) { - if (int i = tmp->stats.stat (j)) - { - success = 1; - DIFF_MSG (i * flag, gain_msg[j], lose_msg[j]); - } + success = 1; + DIFF_MSG (i * flag, gain_msg[j], lose_msg[j]); } - } return success; }