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

Comparing deliantra/server/server/spell_effect.C (file contents):
Revision 1.100 by root, Mon Apr 27 01:38:49 2009 UTC vs.
Revision 1.101 by root, Mon Apr 27 01:44:49 2009 UTC

1466cast_identify (object *op, object *caster, object *spell) 1466cast_identify (object *op, object *caster, object *spell)
1467{ 1467{
1468 object *tmp; 1468 object *tmp;
1469 dynbuf_text &buf = msg_dynbuf; buf.clear (); 1469 dynbuf_text &buf = msg_dynbuf; buf.clear ();
1470 1470
1471 int num_ident = spell->stats.dam + SP_level_dam_adjust (caster, spell); 1471 int num_ident = max (1, spell->stats.dam + SP_level_dam_adjust (caster, spell));
1472
1473 if (num_ident < 1)
1474 num_ident = 1;
1475 1472
1476 for (tmp = op->inv; tmp; tmp = tmp->below) 1473 for (tmp = op->inv; tmp; tmp = tmp->below)
1477 { 1474 {
1478 if (!QUERY_FLAG (tmp, FLAG_IDENTIFIED) && !tmp->invisible && need_identify (tmp)) 1475 if (!QUERY_FLAG (tmp, FLAG_IDENTIFIED) && !tmp->invisible && need_identify (tmp))
1479 { 1476 {
1485 1482
1486 if (tmp->msg) 1483 if (tmp->msg)
1487 buf << "The item has a story:\r" << tmp->msg << "\n\n"; 1484 buf << "The item has a story:\r" << tmp->msg << "\n\n";
1488 } 1485 }
1489 1486
1490 num_ident--;
1491 if (!num_ident) 1487 if (!--num_ident)
1492 break; 1488 break;
1493 } 1489 }
1494 } 1490 }
1495 1491
1496 /* If all the power of the spell has been used up, don't go and identify 1492 /* If all the power of the spell has been used up, don't go and identify
1510 1506
1511 if (tmp->msg) 1507 if (tmp->msg)
1512 buf << "The item has a story:\r" << tmp->msg << "\n\n"; 1508 buf << "The item has a story:\r" << tmp->msg << "\n\n";
1513 } 1509 }
1514 1510
1515 num_ident--;
1516 if (!num_ident) 1511 if (!--num_ident)
1517 break; 1512 break;
1518 } 1513 }
1519 } 1514 }
1520 1515
1521 if (buf.empty ()) 1516 if (buf.empty ())

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines