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

Comparing deliantra/server/common/item.C (file contents):
Revision 1.59 by root, Mon Oct 12 21:27:54 2009 UTC vs.
Revision 1.60 by root, Thu Oct 15 20:12:35 2009 UTC

381 * but do put a newline at the end. Useful when dumping to files 381 * but do put a newline at the end. Useful when dumping to files
382 */ 382 */
383const char * 383const char *
384describe_resistance (const object *op, int newline) 384describe_resistance (const object *op, int newline)
385{ 385{
386 static char buf[VERY_BIG_BUF]; 386 static dynbuf_text buf; buf.clear ();
387 char buf1[VERY_BIG_BUF];
388 int tmpvar;
389 387
390 buf[0] = 0; 388 for (int i = 0; i < NROFATTACKS; i++)
391 for (tmpvar = 0; tmpvar < NROFATTACKS; tmpvar++)
392 {
393 if (op->resist[tmpvar] && (op->type != FLESH || atnr_is_dragon_enabled (tmpvar) == 1)) 389 if (op->resist[i] && (op->type != FLESH || atnr_is_dragon_enabled (i) == 1))
394 { 390 buf.printf (newline ? "%s %d\n" : "(%s %+d)", resist_plus[i], op->resist[i]);
395 if (!newline)
396 sprintf (buf1, "(%s %+d)", resist_plus[tmpvar], op->resist[tmpvar]);
397 else
398 sprintf (buf1, "%s %d\n", resist_plus[tmpvar], op->resist[tmpvar]);
399
400 strcat (buf, buf1);
401 }
402 }
403 391
404 return buf; 392 return buf;
405} 393}
406 394
407 395

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines