ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/common/living.C
(Generate patch)

Comparing deliantra/server/common/living.C (file contents):
Revision 1.71 by elmex, Sat Jul 21 14:37:25 2007 UTC vs.
Revision 1.72 by root, Sun Jul 22 14:17:56 2007 UTC

808 ac = arch->stats.ac; 808 ac = arch->stats.ac;
809 809
810 stats.luck = arch->stats.luck; 810 stats.luck = arch->stats.luck;
811 speed = arch->speed; 811 speed = arch->speed;
812 812
813 sint16 digestion = 0; // a local var to add digestion
814
815 /* OK - we've reset most all the objects attributes to sane values. 813 /* OK - we've reset most all the objects attributes to sane values.
816 * now go through and make adjustments for what the player has equipped. 814 * now go through and make adjustments for what the player has equipped.
817 */ 815 */
818 for (tmp = inv; tmp; tmp = tmp->below) 816 for (tmp = inv; tmp; tmp = tmp->below)
819 { 817 {
891 tmp->type == AMULET || tmp->type == GIRDLE || 889 tmp->type == AMULET || tmp->type == GIRDLE ||
892 tmp->type == BRACERS || tmp->type == CLOAK || 890 tmp->type == BRACERS || tmp->type == CLOAK ||
893 tmp->type == DISEASE || tmp->type == FORCE || 891 tmp->type == DISEASE || tmp->type == FORCE ||
894 tmp->type == SKILL) 892 tmp->type == SKILL)
895 { 893 {
896 digestion += tmp->stats.food; 894 contr->digestion = clamp (int (contr->digestion) + tmp->stats.food, MIN_DIGESTION, MAX_DIGESTION);
897 contr->gen_hp += tmp->stats.hp; 895 contr->gen_hp += tmp->stats.hp;
898 contr->gen_sp += tmp->stats.sp; 896 contr->gen_sp += tmp->stats.sp;
899 contr->gen_grace += tmp->stats.grace; 897 contr->gen_grace += tmp->stats.grace;
900 contr->gen_sp_armour += tmp->gen_sp_armour; 898 contr->gen_sp_armour += tmp->gen_sp_armour;
901 } 899 }
1134 1132
1135 break; 1133 break;
1136 } /* switch tmp->type */ 1134 } /* switch tmp->type */
1137 } /* item is equipped */ 1135 } /* item is equipped */
1138 } /* for loop of items */ 1136 } /* for loop of items */
1139
1140 // now clamp digestion to our limits
1141 contr->digestion = clamp (digestion, MIN_DIGESTION, MAX_DIGESTION);
1142 1137
1143 /* We've gone through all the objects the player has equipped. For many things, we 1138 /* We've gone through all the objects the player has equipped. For many things, we
1144 * have generated intermediate values which we now need to assign. 1139 * have generated intermediate values which we now need to assign.
1145 */ 1140 */
1146 1141

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines