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

Comparing deliantra/server/server/build_map.C (file contents):
Revision 1.57 by elmex, Tue Apr 13 18:10:54 2010 UTC vs.
Revision 1.59 by root, Tue Apr 13 18:56:00 2010 UTC

699 * or remover object. 699 * or remover object.
700 */ 700 */
701void 701void
702apply_map_builder (object *pl, int dir) 702apply_map_builder (object *pl, int dir)
703{ 703{
704 object *builder = 0;
705 object *tmp = 0;
706 object *tmp2 = 0;
707 int x, y; 704 int x, y;
708 705
709 if (!pl->type == PLAYER) 706 if (!pl->type == PLAYER)
710 return; 707 return;
711 708
735 * The square must have only buildable items 732 * The square must have only buildable items
736 * Exception: marking runes are all right, 733 * Exception: marking runes are all right,
737 * since they are used for special things like connecting doors / buttons 734 * since they are used for special things like connecting doors / buttons
738 */ 735 */
739 736
740 tmp = GET_MAP_OB (pl->map, x, y); 737 object *tmp = GET_MAP_OB (pl->map, x, y);
741 if (!tmp) 738 if (!tmp)
742 { 739 {
743 /* Nothing, meaning player is standing next to an undefined square... */ 740 /* Nothing, meaning player is standing next to an undefined square... */
744 LOG (llevError, "apply_map_builder: undefined square at (%d, %d, %s)\n", x, y, &pl->map->path); 741 LOG (llevError, "apply_map_builder: undefined square at (%d, %d, %s)\n", x, y, &pl->map->path);
745 new_draw_info (NDI_UNIQUE, 0, pl, "You'd better not build here, it looks weird."); 742 new_draw_info (NDI_UNIQUE, 0, pl, "You'd better not build here, it looks weird.");
746 return; 743 return;
747 } 744 }
748 745
749 if (INVOKE_PLAYER (BUILD, pl->contr, ARG_OBJECT (builder), ARG_MAP (pl->map), ARG_INT (x), ARG_INT (y))) 746 object *builder = pl->contr->ranged_ob;
750 return;
751 747
752 tmp2 = find_marked_object (pl); 748 object *tmp2 = find_marked_object (pl);
753 while (tmp) 749 while (tmp)
754 { 750 {
755 if (!tmp->flag [FLAG_IS_BUILDABLE] && (tmp->type != SIGN || tmp->arch->archname != shstr_rune_mark)) 751 if (!tmp->flag [FLAG_IS_BUILDABLE] && (tmp->type != SIGN || tmp->arch->archname != shstr_rune_mark))
756 { 752 {
757 /* The item building function already has it's own special 753 /* The item building function already has it's own special
758 * checks for this 754 * checks for this
759 */ 755 */
760 if (!tmp2 || tmp2->subtype != ST_MAT_ITEM) 756 if (!tmp2 || tmp2->subtype != ST_MAT_ITEM)
761 { 757 {
758 if (!INVOKE_PLAYER (BUILD, pl->contr, ARG_OBJECT (builder), ARG_MAP (pl->map), ARG_INT (x), ARG_INT (y), ARG_INT (0)))
762 new_draw_info (NDI_UNIQUE, 0, pl, "You can't build here."); 759 new_draw_info (NDI_UNIQUE, 0, pl, "You can't build here.");
760
763 return; 761 return;
764 } 762 }
765 } 763 }
766 764
767 tmp = tmp->above; 765 tmp = tmp->above;
768 } 766 }
769 767
770 /* Now we know the square is ok */ 768 /* Now we know the square is ok */
771 builder = pl->contr->ranged_ob; 769 if (INVOKE_PLAYER (BUILD, pl->contr, ARG_OBJECT (builder), ARG_MAP (pl->map), ARG_INT (x), ARG_INT (y), ARG_INT (1)))
770 return;
772 771
773 if (builder->subtype == ST_BD_REMOVE) 772 if (builder->subtype == ST_BD_REMOVE)
774 /* Remover -> call specific function and bail out */ 773 /* Remover -> call specific function and bail out */
775 { 774 {
776 apply_builder_remove (pl, dir); 775 apply_builder_remove (pl, dir);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines