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

Comparing deliantra/server/server/player.C (file contents):
Revision 1.154 by root, Sat Jul 14 14:57:16 2007 UTC vs.
Revision 1.155 by root, Sat Jul 21 15:04:36 2007 UTC

2557 } 2557 }
2558 2558
2559 /* Digestion */ 2559 /* Digestion */
2560 if (--op->last_eat < 0) 2560 if (--op->last_eat < 0)
2561 { 2561 {
2562 int bonus = op->contr->digestion > 0 ? op->contr->digestion : 0, penalty = op->contr->digestion < 0 ? -op->contr->digestion : 0; 2562 int bonus = max (0, op->contr->digestion),
2563 penalty = max (0, -op->contr->digestion);
2563 2564
2564 if (op->contr->gen_hp > 0)
2565 op->last_eat = 25 * (1 + bonus) / (op->contr->gen_hp + penalty + 1); 2565 op->last_eat = 25 * (1 + bonus) / (max (0, op->contr->gen_hp) + penalty + 1);
2566 else
2567 op->last_eat = 25 * (1 + bonus) / (penalty + 1);
2568 2566
2569 /* dms do not consume food */ 2567 /* dms do not consume food */
2570 if (!QUERY_FLAG (op, FLAG_WIZ)) 2568 if (!QUERY_FLAG (op, FLAG_WIZ))
2571 op->stats.food--; 2569 op->stats.food--;
2572 } 2570 }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines