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

Comparing deliantra/server/common/map.C (file contents):
Revision 1.196 by root, Sun Apr 25 10:45:38 2010 UTC vs.
Revision 1.197 by root, Thu Apr 29 07:32:34 2010 UTC

559 * the map (or something equivilent) into output_string. */ 559 * the map (or something equivilent) into output_string. */
560static const char * 560static const char *
561print_shop_string (maptile *m) 561print_shop_string (maptile *m)
562{ 562{
563 static dynbuf_text buf; buf.clear (); 563 static dynbuf_text buf; buf.clear ();
564 bool first = true;
564 565
565 for (int i = 0; i < m->shopitems[0].index; i++) 566 for (int i = 0; i < m->shopitems[0].index; i++)
566 { 567 {
568 if (!first)
569 buf << ';';
570
571 first = false;
572
567 if (m->shopitems[i].typenum) 573 if (m->shopitems[i].typenum)
568 { 574 {
569 if (m->shopitems[i].strength) 575 if (m->shopitems[i].strength)
570 buf.printf ("%s:%d;", m->shopitems[i].name, m->shopitems[i].strength); 576 buf.printf ("%s:%d", m->shopitems[i].name, m->shopitems[i].strength);
571 else 577 else
572 buf.printf ("%s;", m->shopitems[i].name); 578 buf.printf ("%s", m->shopitems[i].name);
573 } 579 }
574 else 580 else
575 { 581 {
576 if (m->shopitems[i].strength) 582 if (m->shopitems[i].strength)
577 buf.printf ("*:%d;", m->shopitems[i].strength); 583 buf.printf ("*:%d", m->shopitems[i].strength);
578 else 584 else
579 buf.printf ("*"); 585 buf.printf ("*");
580 } 586 }
581 } 587 }
582 588

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines