--- deliantra/server/common/living.C 2007/05/07 03:05:57 1.47 +++ deliantra/server/common/living.C 2007/05/12 17:26:51 1.49 @@ -359,7 +359,7 @@ * It is the calling functions responsibilty to check to see if the object * can be applied or not. * The main purpose of calling this function is the messages that are - * displayed - fix_player should really always be called after this when + * displayed - update_stats should really always be called after this when * removing an object - that is because it is impossible to know if some object * is the only source of an attacktype or spell attunement, so this function * will clear the bits, but the player may still have some other object @@ -400,14 +400,12 @@ */ if (nstat < 1 && i * flag < 0) nstat = 1; - else if (nstat > 20 + get_attr_value (&(op->arch->clone.stats), j)) - { - nstat = 20 + get_attr_value (&(op->arch->clone.stats), j); - } + else if (nstat > 20 + get_attr_value (&op->arch->clone.stats, j)) + nstat = 20 + get_attr_value (&op->arch->clone.stats, j); if (nstat != ostat) { - set_attr_value (&(op->contr->orig_stats), j, nstat); + set_attr_value (&op->contr->orig_stats, j, nstat); potion_max = 0; } else if (i) @@ -422,9 +420,9 @@ * recalculates this anyway. */ for (j = 0; j < NUM_STATS; j++) - change_attr_value (&(op->stats), j, flag * get_attr_value (&(tmp->stats), j)); + change_attr_value (&op->stats, j, flag * get_attr_value (&tmp->stats, j)); - check_stat_bounds (&(op->stats)); + check_stat_bounds (&op->stats); } /* end of potion handling code */ } @@ -433,18 +431,18 @@ */ if (flag == -1) { - op->attacktype &= ~tmp->attacktype; - op->path_attuned &= ~tmp->path_attuned; + op->attacktype &= ~tmp->attacktype; + op->path_attuned &= ~tmp->path_attuned; op->path_repelled &= ~tmp->path_repelled; - op->path_denied &= ~tmp->path_denied; + op->path_denied &= ~tmp->path_denied; /* Presuming here that creatures only have move_type, * and not the other move_ fields. */ - op->move_type &= ~tmp->move_type; + op->move_type &= ~tmp->move_type; } /* call fix_player since op object could have whatever attribute due - * to multiple items. if fix_player always has to be called after + * to multiple items. if fix_player always has to be called after * change_ability then might as well call it from here */ op->update_stats (); @@ -502,6 +500,7 @@ DIFF_MSG (flag, "You soar into the air air!.", (op->move_type & MOVE_FLY_LOW ? "You fly lower in the air" : "You float down to the ground.")); } + if (tmp->move_type & MOVE_SWIM) DIFF_MSG (flag, "You feel ready for a swim", "You no longer feel like swimming"); @@ -675,7 +674,6 @@ * Stat draining by Vick 930307 * (Feeling evil, I made it work as well now. -Frank 8) */ - void object::drain_stat () { @@ -966,7 +964,7 @@ * because the skill shouldn't count against body positions being used * up, etc. */ - if ((QUERY_FLAG (tmp, FLAG_APPLIED) + if ((tmp->flag [FLAG_APPLIED] && tmp->type != CONTAINER && tmp->type != CLOSE_CON) || (tmp->type == SKILL @@ -974,9 +972,9 @@ { if (type == PLAYER) { - if ((tmp->type == WEAPON || tmp->type == BOW) - && tmp != current_weapon) - continue; + if (tmp == contr->combat_ob || tmp == contr->ranged_ob) + if (tmp != current_weapon && (tmp->type != SKILL || tmp->subtype != SK_PRAYING)) + continue; for (i = 0; i < NUM_STATS; i++) change_attr_value (&stats, i, get_attr_value (&tmp->stats, i)); @@ -985,14 +983,14 @@ * spell point recovery and mana point recovery. Seems sort of an arbitary * list, but other items store other info into stats array. */ - if ((tmp->type == WEAPON) || (tmp->type == BOW) || - (tmp->type == ARMOUR) || (tmp->type == HELMET) || - (tmp->type == SHIELD) || (tmp->type == RING) || - (tmp->type == BOOTS) || (tmp->type == GLOVES) || - (tmp->type == AMULET) || (tmp->type == GIRDLE) || - (tmp->type == BRACERS) || (tmp->type == CLOAK) || - (tmp->type == DISEASE) || (tmp->type == FORCE) || - (tmp->type == SKILL)) + if (tmp->type == WEAPON || tmp->type == BOW || + tmp->type == ARMOUR || tmp->type == HELMET || + tmp->type == SHIELD || tmp->type == RING || + tmp->type == BOOTS || tmp->type == GLOVES || + tmp->type == AMULET || tmp->type == GIRDLE || + tmp->type == BRACERS || tmp->type == CLOAK || + tmp->type == DISEASE || tmp->type == FORCE || + tmp->type == SKILL) { contr->digestion += tmp->stats.food; contr->gen_hp += tmp->stats.hp;