--- deliantra/server/common/living.C 2007/05/19 00:31:08 1.62 +++ deliantra/server/common/living.C 2007/05/22 10:49:57 1.63 @@ -996,41 +996,49 @@ /* skills modifying the character -b.t. */ /* for all skills and skill granting objects */ case SKILL: - if (!QUERY_FLAG (tmp, FLAG_APPLIED) || skill_flags [tmp->subtype] & SF_APPLY) - break; - - if (chosen_skill) - LOG (llevDebug, "fix_player, op %s has multiple skills applied (%s and %s)\n", - &name, &chosen_skill->name, &tmp->name); - - chosen_skill = tmp; - - if (tmp->stats.dam > 0) - { /* skill is a 'weapon' */ - if (!QUERY_FLAG (this, FLAG_READY_WEAPON)) - weapon_speed = WEAPON_SPEED (tmp); - - if (weapon_speed < 0) - weapon_speed = 0; - - weapon_weight = tmp->weight; - stats.dam += 1 + (chosen_skill->level * tmp->stats.dam / 9); - - if (tmp->magic) - stats.dam += tmp->magic; - } - - if (tmp->stats.wc) - wc -= tmp->stats.wc + tmp->magic; - - if (tmp->slaying) - slaying = tmp->slaying; - - if (tmp->stats.ac) - ac -= tmp->stats.ac + tmp->magic; - - if (settings.spell_encumbrance == TRUE && type == PLAYER) - contr->encumbrance += (int) 3 *tmp->weight / 1000; + { + if (!QUERY_FLAG (tmp, FLAG_APPLIED) || skill_flags [tmp->subtype] & SF_APPLY) + break; + + if (chosen_skill) + { + LOG (llevDebug, "fix_player, op %s has multiple skills applied (%s and %s)\n", + &name, &chosen_skill->name, &tmp->name); + + tmp->flag [FLAG_APPLIED] = false; + update_stats (); + return; + } + else + chosen_skill = tmp; + + if (tmp->stats.dam > 0) + { /* skill is a 'weapon' */ + if (!QUERY_FLAG (this, FLAG_READY_WEAPON)) + weapon_speed = WEAPON_SPEED (tmp); + + if (weapon_speed < 0) + weapon_speed = 0; + + weapon_weight = tmp->weight; + stats.dam += 1 + chosen_skill->level * tmp->stats.dam / 9; + + if (tmp->magic) + stats.dam += tmp->magic; + } + + if (tmp->stats.wc) + wc -= tmp->stats.wc + tmp->magic; + + if (tmp->slaying) + slaying = tmp->slaying; + + if (tmp->stats.ac) + ac -= tmp->stats.ac + tmp->magic; + + if (settings.spell_encumbrance == TRUE && type == PLAYER) + contr->encumbrance += (int) 3 *tmp->weight / 1000; + } break;