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.51 by root, Sat May 12 18:23:51 2007 UTC vs.
Revision 1.52 by root, Sat May 12 18:34:19 2007 UTC

242change_attr_value (living *stats, int attr, sint8 value) 242change_attr_value (living *stats, int attr, sint8 value)
243{ 243{
244 stats->stat (attr) += value; 244 stats->stat (attr) += value;
245} 245}
246 246
247sint8 &
248living::stat (int index)
249{
250 switch (index)
251 {
252 case STR: return Str;
253 case DEX: return Dex;
254 case CON: return Con;
255 case INT: return Int;
256 case WIS: return Wis;
257 case POW: return Pow;
258 case CHA: return Cha;
259 }
260
261 LOG (llevError | logBacktrace, "living.stat() called with out-of-range stat index");
262 static sint8 dummy;
263 return dummy;
264}
265
266sint8
267living::stat (int index) const
268{
269 switch (index)
270 {
271 case STR: return Str;
272 case DEX: return Dex;
273 case CON: return Con;
274 case INT: return Int;
275 case WIS: return Wis;
276 case POW: return Pow;
277 case CHA: return Cha;
278 }
279
280 LOG (llevError | logBacktrace, "living.stat() called with out-of-range stat index");
281 static sint8 dummy;
282 return dummy;
283}
284
285/* 247/*
286 * Ensures that all stats (str/dex/con/wis/cha/int) are within the 248 * Ensures that all stats (str/dex/con/wis/cha/int) are within the
287 * 1-30 stat limit. 249 * 1-30 stat limit.
288 */ 250 */
289void 251void

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines