… | |
… | |
77 | /* Make sure the coordinates are valid - they should be, as caller should |
77 | /* Make sure the coordinates are valid - they should be, as caller should |
78 | * have already checked this. |
78 | * have already checked this. |
79 | */ |
79 | */ |
80 | if (OUT_OF_REAL_MAP (m, sx, sy)) |
80 | if (OUT_OF_REAL_MAP (m, sx, sy)) |
81 | { |
81 | { |
82 | LOG (llevError, "blocked_link: Passed map, x, y coordinates outside of map\n"); |
82 | LOG (llevError | logBacktrace, "blocked_link: Passed map, x, y coordinates outside of map\n"); |
83 | return 1; |
83 | return 1; |
84 | } |
84 | } |
85 | |
85 | |
86 | mapspace &ms = m->at (sx, sy); |
86 | mapspace &ms = m->at (sx, sy); |
87 | |
87 | |
… | |
… | |
90 | |
90 | |
91 | /* If space is currently not blocked by anything, no need to |
91 | /* If space is currently not blocked by anything, no need to |
92 | * go further. Not true for players - all sorts of special |
92 | * go further. Not true for players - all sorts of special |
93 | * things we need to do for players. |
93 | * things we need to do for players. |
94 | */ |
94 | */ |
95 | if (ob->type != PLAYER && !(mflags & P_IS_ALIVE) && (blocked == 0)) |
95 | if (ob->type != PLAYER && !(mflags & P_IS_ALIVE) && blocked == 0) |
96 | return 0; |
96 | return 0; |
97 | |
97 | |
98 | /* if there isn't anything alive on this space, and this space isn't |
98 | /* if there isn't anything alive on this space, and this space isn't |
99 | * otherwise blocked, we can return now. Only if there is a living |
99 | * otherwise blocked, we can return now. Only if there is a living |
100 | * creature do we need to investigate if it is part of this creature |
100 | * creature do we need to investigate if it is part of this creature |
… | |
… | |
559 | * the map (or something equivilent) into output_string. */ |
559 | * the map (or something equivilent) into output_string. */ |
560 | static const char * |
560 | static const char * |
561 | print_shop_string (maptile *m) |
561 | print_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 | |
… | |
… | |
638 | case KW_per_player: thawer.get (per_player); break; |
644 | case KW_per_player: thawer.get (per_player); break; |
639 | case KW_per_party: thawer.get (per_party); break; |
645 | case KW_per_party: thawer.get (per_party); break; |
640 | case KW_no_reset: thawer.get (no_reset); break; |
646 | case KW_no_reset: thawer.get (no_reset); break; |
641 | case KW_no_drop: thawer.get (no_drop); break; |
647 | case KW_no_drop: thawer.get (no_drop); break; |
642 | |
648 | |
643 | case KW_region: default_region = region::find (thawer.get_str ()); break; |
649 | case KW_region: thawer.get (default_region); break; |
644 | case KW_shopitems: shopitems = parse_shop_string (thawer.get_str ()); break; |
650 | case KW_shopitems: shopitems = parse_shop_string (thawer.get_str ()); break; |
645 | |
651 | |
646 | // old names new names |
652 | // old names new names |
647 | case KW_hp: case KW_enter_x: thawer.get (enter_x); break; |
653 | case KW_hp: case KW_enter_x: thawer.get (enter_x); break; |
648 | case KW_sp: case KW_enter_y: thawer.get (enter_y); break; |
654 | case KW_sp: case KW_enter_y: thawer.get (enter_y); break; |