1 | /* |
1 | /* |
2 | * This file is part of Deliantra, the Roguelike Realtime MMORPG. |
2 | * This file is part of Deliantra, the Roguelike Realtime MMORPG. |
3 | * |
3 | * |
4 | * Copyright (©) 2005,2006,2007,2008 Marc Alexander Lehmann / Robin Redeker / the Deliantra team |
4 | * Copyright (©) 2005,2006,2007,2008,2009,2010,2011,2012 Marc Alexander Lehmann / Robin Redeker / the Deliantra team |
5 | * Copyright (©) 2001 Mark Wedel & Crossfire Development Team |
5 | * Copyright (©) 2001 Mark Wedel & Crossfire Development Team |
6 | * Copyright (©) 1992 Frank Tore Johansen |
6 | * Copyright (©) 1992 Frank Tore Johansen |
7 | * |
7 | * |
8 | * Deliantra is free software: you can redistribute it and/or modify it under |
8 | * Deliantra is free software: you can redistribute it and/or modify it under |
9 | * the terms of the Affero GNU General Public License as published by the |
9 | * the terms of the Affero GNU General Public License as published by the |
10 | * Free Software Foundation, either version 3 of the License, or (at your |
10 | * Free Software Foundation, either version 3 of the License, or (at your |
11 | * option) any later version. |
11 | * option) any later version. |
12 | * |
12 | * |
13 | * This program is distributed in the hope that it will be useful, |
13 | * This program is distributed in the hope that it will be useful, |
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
16 | * GNU General Public License for more details. |
16 | * GNU General Public License for more details. |
17 | * |
17 | * |
18 | * You should have received a copy of the Affero GNU General Public License |
18 | * You should have received a copy of the Affero GNU General Public License |
19 | * and the GNU General Public License along with this program. If not, see |
19 | * and the GNU General Public License along with this program. If not, see |
20 | * <http://www.gnu.org/licenses/>. |
20 | * <http://www.gnu.org/licenses/>. |
21 | * |
21 | * |
22 | * The authors can be reached via e-mail to <support@deliantra.net> |
22 | * The authors can be reached via e-mail to <support@deliantra.net> |
23 | */ |
23 | */ |
24 | |
24 | |
25 | #include <global.h> |
25 | #include <global.h> |
26 | #include <living.h> |
26 | #include <living.h> |
… | |
… | |
28 | #include <skills.h> |
28 | #include <skills.h> |
29 | #include <tod.h> |
29 | #include <tod.h> |
30 | #include <sproto.h> |
30 | #include <sproto.h> |
31 | |
31 | |
32 | // macro for this check, it had been inconsistent in this file. |
32 | // macro for this check, it had been inconsistent in this file. |
33 | #define IS_FLOOR(x) ((x)->type == FLOOR || QUERY_FLAG((x), FLAG_IS_FLOOR)) |
33 | #define IS_FLOOR(x) x->flag [FLAG_IS_FLOOR] |
34 | |
34 | |
35 | /** |
35 | /** |
36 | * Check if objects on a square interfere with building |
36 | * Check if objects on a square interfere with building |
37 | */ |
37 | */ |
38 | static int |
38 | static int |
… | |
… | |
174 | { |
174 | { |
175 | new_draw_info (NDI_UNIQUE, 0, pl, "Could not create more groups."); |
175 | new_draw_info (NDI_UNIQUE, 0, pl, "Could not create more groups."); |
176 | return shstr_tmp (); |
176 | return shstr_tmp (); |
177 | } |
177 | } |
178 | |
178 | |
179 | force = get_archetype (FORCE_NAME); |
179 | force = archetype::get (FORCE_NAME); |
180 | force->slaying = pl->map->path; |
180 | force->slaying = pl->map->path; |
181 | force->msg = rune->msg; |
181 | force->msg = rune->msg; |
182 | force->race = id; |
182 | force->race = id; |
183 | force->set_speed (0); |
183 | force->set_speed (0); |
184 | |
184 | |
… | |
… | |
222 | { |
222 | { |
223 | new_draw_info (NDI_UNIQUE, 0, pl, "You need to put a book or scroll with the message."); |
223 | new_draw_info (NDI_UNIQUE, 0, pl, "You need to put a book or scroll with the message."); |
224 | return -1; |
224 | return -1; |
225 | } |
225 | } |
226 | |
226 | |
|
|
227 | if (tmp->type == MAGIC_EAR) |
|
|
228 | { |
|
|
229 | snprintf (buf, sizeof (buf), "@match %s", &(book->msg)); |
|
|
230 | tmp->msg = buf; |
|
|
231 | } |
|
|
232 | else |
227 | tmp->msg = book->msg; |
233 | tmp->msg = book->msg; |
228 | |
234 | |
229 | if (tmp->invisible) |
235 | if (tmp->invisible) |
230 | { |
236 | { |
231 | if (book->custom_name) |
237 | if (book->custom_name) |
232 | snprintf (buf, sizeof (buf), "talking %s", &book->custom_name); |
238 | snprintf (buf, sizeof (buf), "talking %s", &book->custom_name); |
… | |
… | |
307 | if (x > 0 && get_wall (map, x - 1, y)) connect |= 1; |
313 | if (x > 0 && get_wall (map, x - 1, y)) connect |= 1; |
308 | if (x < map->width - 1 && get_wall (map, x + 1, y)) connect |= 2; |
314 | if (x < map->width - 1 && get_wall (map, x + 1, y)) connect |= 2; |
309 | if (y > 0 && get_wall (map, x, y - 1)) connect |= 4; |
315 | if (y > 0 && get_wall (map, x, y - 1)) connect |= 4; |
310 | if (y < map->height - 1 && get_wall (map, x, y + 1)) connect |= 8; |
316 | if (y < map->height - 1 && get_wall (map, x, y + 1)) connect |= 8; |
311 | |
317 | |
312 | // one bit per dir, 1 left, 2 right, 4 up, 8 down |
|
|
313 | static const char *walltype[16] = { |
|
|
314 | "0", |
|
|
315 | "1_3", |
|
|
316 | "1_4", |
|
|
317 | "2_1_2", |
|
|
318 | "1_2", |
|
|
319 | "2_2_4", |
|
|
320 | "2_2_1", |
|
|
321 | "3_1", |
|
|
322 | "1_1", |
|
|
323 | "2_2_3", |
|
|
324 | "2_2_2", |
|
|
325 | "3_3", |
|
|
326 | "2_1_1", |
|
|
327 | "3_4", |
|
|
328 | "3_2", |
|
|
329 | "4" |
|
|
330 | }; |
|
|
331 | |
|
|
332 | strcat (archetype, walltype [connect]); |
318 | strcat (archetype, wall_suffix [connect]); |
333 | |
319 | |
334 | /* |
320 | /* |
335 | * Before anything, make sure the archetype does exist... |
321 | * Before anything, make sure the archetype does exist... |
336 | * If not, prolly an error... |
322 | * If not, prolly an error... |
337 | */ |
323 | */ |
… | |
… | |
422 | LOG (llevError, "apply_builder_floor: unable to find archetype %s.\n", &material->slaying); |
408 | LOG (llevError, "apply_builder_floor: unable to find archetype %s.\n", &material->slaying); |
423 | return; |
409 | return; |
424 | } |
410 | } |
425 | |
411 | |
426 | tmp = new_floor->instance (); |
412 | tmp = new_floor->instance (); |
427 | SET_FLAG (tmp, FLAG_IS_BUILDABLE); |
413 | tmp->set_flag (FLAG_IS_BUILDABLE); |
428 | SET_FLAG (tmp, FLAG_UNIQUE); |
414 | tmp->set_flag (FLAG_UNIQUE); |
429 | SET_FLAG (tmp, FLAG_IS_FLOOR); |
415 | tmp->set_flag (FLAG_IS_FLOOR); |
430 | tmp->type = FLOOR; |
416 | //tmp->type = FLOOR; |
431 | insert_ob_in_map_at (tmp, pl->map, above_floor, above_floor ? INS_BELOW_ORIGINATOR : INS_ON_TOP, x, y); |
417 | insert_ob_in_map_at (tmp, pl->map, above_floor, above_floor ? INS_BELOW_ORIGINATOR : INS_ON_TOP, x, y); |
432 | |
418 | |
433 | /* |
419 | /* |
434 | * Next step: make sure there are either walls or floors around the new square |
420 | * Next step: make sure there are either walls or floors around the new square |
435 | * Since building, you can have: blocking view / floor / wall / nothing |
421 | * Since building, you can have: blocking view / floor / wall / nothing |
… | |
… | |
442 | if (!tmp) |
428 | if (!tmp) |
443 | { |
429 | { |
444 | /* Must insert floor & wall */ |
430 | /* Must insert floor & wall */ |
445 | tmp = new_floor->instance (); |
431 | tmp = new_floor->instance (); |
446 | /* Better make the floor unique */ |
432 | /* Better make the floor unique */ |
447 | SET_FLAG (tmp, FLAG_UNIQUE); |
433 | tmp->set_flag (FLAG_UNIQUE); |
448 | SET_FLAG (tmp, FLAG_IS_BUILDABLE); |
434 | tmp->set_flag (FLAG_IS_BUILDABLE); |
449 | tmp->type = FLOOR; |
435 | //tmp->type = FLOOR; |
450 | insert_ob_in_map_at (tmp, pl->map, 0, 0, xt, yt); |
436 | insert_ob_in_map_at (tmp, pl->map, 0, 0, xt, yt); |
451 | /* Insert wall if exists. Note: if it doesn't, the map is weird... */ |
437 | /* Insert wall if exists. Note: if it doesn't, the map is weird... */ |
452 | if (new_wall) |
438 | if (new_wall) |
453 | { |
439 | { |
454 | tmp = new_wall->instance (); |
440 | tmp = new_wall->instance (); |
455 | SET_FLAG (tmp, FLAG_IS_BUILDABLE); |
441 | tmp->set_flag (FLAG_IS_BUILDABLE); |
456 | tmp->type = BUILDABLE_WALL; |
442 | tmp->type = BUILDABLE_WALL; |
457 | insert_ob_in_map_at (tmp, pl->map, 0, 0, xt, yt); |
443 | insert_ob_in_map_at (tmp, pl->map, 0, 0, xt, yt); |
458 | } |
444 | } |
459 | } |
445 | } |
460 | } |
446 | } |
… | |
… | |
515 | return; |
501 | return; |
516 | } |
502 | } |
517 | |
503 | |
518 | tmp = new_wall->instance (); |
504 | tmp = new_wall->instance (); |
519 | tmp->type = BUILDABLE_WALL; |
505 | tmp->type = BUILDABLE_WALL; |
520 | SET_FLAG (tmp, FLAG_IS_BUILDABLE); |
506 | tmp->set_flag (FLAG_IS_BUILDABLE); |
521 | insert_ob_in_map_at (tmp, pl->map, 0, INS_ABOVE_FLOOR_ONLY, x, y); |
507 | insert_ob_in_map_at (tmp, pl->map, 0, INS_ABOVE_FLOOR_ONLY, x, y); |
522 | |
508 | |
523 | /* If existing wall, remove it, no need to fix other walls */ |
509 | /* If existing wall, remove it, no need to fix other walls */ |
524 | if (current_wall) |
510 | if (current_wall) |
525 | { |
511 | { |
… | |
… | |
592 | { |
578 | { |
593 | new_draw_info (NDI_UNIQUE, 0, pl, "You can't build here."); |
579 | new_draw_info (NDI_UNIQUE, 0, pl, "You can't build here."); |
594 | return; |
580 | return; |
595 | } |
581 | } |
596 | |
582 | |
597 | SET_FLAG (tmp, FLAG_IS_BUILDABLE); |
583 | tmp->set_flag (FLAG_IS_BUILDABLE); |
598 | SET_FLAG (tmp, FLAG_NO_PICK); |
584 | tmp->set_flag (FLAG_NO_PICK); |
599 | |
585 | |
600 | /* |
586 | /* |
601 | * Str 1 is a flag that the item [pedestal] should go below the floor. |
587 | * Str 1 is a flag that the item [pedestal] should go below the floor. |
602 | * Items under the floor on non-unique maps will not be saved, |
588 | * Items under the floor on non-unique maps will not be saved, |
603 | * so make the item itself unique in this situation. |
589 | * so make the item itself unique in this situation. |
604 | */ |
590 | */ |
605 | insert_flag = item->stats.Str == 1 ? INS_BELOW_ORIGINATOR : INS_ABOVE_FLOOR_ONLY; |
591 | insert_flag = item->stats.Str == 1 ? INS_BELOW_ORIGINATOR : INS_ABOVE_FLOOR_ONLY; |
606 | if (insert_flag == INS_BELOW_ORIGINATOR && !pl->map->no_reset) |
592 | if (insert_flag == INS_BELOW_ORIGINATOR && !pl->map->no_reset) |
607 | SET_FLAG (tmp, FLAG_UNIQUE); |
593 | tmp->set_flag (FLAG_UNIQUE); |
608 | |
594 | |
609 | shstr_tmp connected; |
595 | shstr_tmp connected; |
610 | |
596 | |
611 | switch (tmp->type) |
597 | switch (tmp->type) |
612 | { |
598 | { |
… | |
… | |
690 | new_draw_info_format (NDI_UNIQUE, 0, pl, "You remove the %s", query_name (item)); |
676 | new_draw_info_format (NDI_UNIQUE, 0, pl, "You remove the %s", query_name (item)); |
691 | item->destroy (); |
677 | item->destroy (); |
692 | } |
678 | } |
693 | } |
679 | } |
694 | |
680 | |
|
|
681 | |
|
|
682 | static void |
|
|
683 | replace_open_space_floor (object *os, object *material) |
|
|
684 | { |
|
|
685 | object *new_floor = archetype::get (material->slaying); |
|
|
686 | insert_ob_in_map_at (new_floor, os->map, os, |
|
|
687 | INS_BELOW_ORIGINATOR, os->x, os->y); |
|
|
688 | os->destroy (); |
|
|
689 | material->decrease (); |
|
|
690 | } |
|
|
691 | |
|
|
692 | /** |
|
|
693 | * Quad building. |
|
|
694 | */ |
|
|
695 | void |
|
|
696 | apply_builder_quad (object *pl, object *material, mapxy &pos) |
|
|
697 | { |
|
|
698 | object *open_space = 0; |
|
|
699 | object *floor = 0; |
|
|
700 | |
|
|
701 | object *tmp = pos.ms ().bot; |
|
|
702 | bool floor_exists = false; |
|
|
703 | while (tmp) |
|
|
704 | { |
|
|
705 | if (floor_exists && tmp->flag [FLAG_IS_QUAD]) |
|
|
706 | { |
|
|
707 | pl->failmsg ( |
|
|
708 | "You can't build there, there is a block in the way."); |
|
|
709 | return; |
|
|
710 | } |
|
|
711 | |
|
|
712 | if (IS_FLOOR (tmp)) |
|
|
713 | { |
|
|
714 | floor = tmp; |
|
|
715 | floor_exists = true; |
|
|
716 | |
|
|
717 | if (floor->arch->archname == shstr_quad_open_space) |
|
|
718 | { |
|
|
719 | open_space = floor; |
|
|
720 | } |
|
|
721 | else if (!floor->flag [FLAG_IS_QUAD]) |
|
|
722 | { |
|
|
723 | pl->failmsg ( |
|
|
724 | "You can't build there, the floor is not suited."); |
|
|
725 | return; |
|
|
726 | } |
|
|
727 | } |
|
|
728 | |
|
|
729 | tmp = tmp->above; |
|
|
730 | } |
|
|
731 | |
|
|
732 | if (open_space) |
|
|
733 | { |
|
|
734 | if (!material->slaying) |
|
|
735 | { |
|
|
736 | pl->failmsg ( |
|
|
737 | "The floor is open and you can't fill it with that material." |
|
|
738 | "H<Use another material to fill the ceiling.>"); |
|
|
739 | return; |
|
|
740 | } |
|
|
741 | |
|
|
742 | replace_open_space_floor (open_space, material); |
|
|
743 | pl->contr->fire_on = 0; // TODO: stopgap, do not add more than one per keypress |
|
|
744 | return; |
|
|
745 | } |
|
|
746 | else if (floor) |
|
|
747 | { |
|
|
748 | |
|
|
749 | maptile *upper_floor = pos.m->tile_available (TILE_UP); |
|
|
750 | if (!upper_floor) |
|
|
751 | { |
|
|
752 | pl->failmsg ( |
|
|
753 | "Whoops, you can't see the ceiling.. H<You may try again.>"); |
|
|
754 | return; |
|
|
755 | } |
|
|
756 | |
|
|
757 | mapxy above_pos (upper_floor, pos.x, pos.y); |
|
|
758 | if (!above_pos.normalise ()) |
|
|
759 | { |
|
|
760 | pl->failmsg ( |
|
|
761 | "Whoops, you can't access the ceiling. H<You may try again.>"); |
|
|
762 | return; |
|
|
763 | } |
|
|
764 | |
|
|
765 | mapspace &above_ms = above_pos.ms (); |
|
|
766 | for (object *quad_obj = above_ms.top; quad_obj; quad_obj = quad_obj->below) |
|
|
767 | { |
|
|
768 | if (quad_obj->arch->archname == shstr_quad_open_space) |
|
|
769 | { |
|
|
770 | if (!material->slaying) |
|
|
771 | { |
|
|
772 | pl->failmsg ( |
|
|
773 | "The ceiling is open and you can't fill it with that material." |
|
|
774 | "H<Use another material to fill the ceiling.>"); |
|
|
775 | return; |
|
|
776 | } |
|
|
777 | |
|
|
778 | replace_open_space_floor (quad_obj, material); |
|
|
779 | break; |
|
|
780 | } |
|
|
781 | } |
|
|
782 | |
|
|
783 | if (material->destroyed ()) |
|
|
784 | { |
|
|
785 | pl->failmsg ( |
|
|
786 | "You don't have enough build material to build a wall here."); |
|
|
787 | return; |
|
|
788 | } |
|
|
789 | |
|
|
790 | object *quad_wall = material->other_arch->instance (); |
|
|
791 | material->decrease (); |
|
|
792 | |
|
|
793 | insert_ob_in_map_at (quad_wall, floor->map, 0, |
|
|
794 | INS_ABOVE_FLOOR_ONLY, floor->x, floor->y); |
|
|
795 | } |
|
|
796 | else |
|
|
797 | { |
|
|
798 | pl->failmsg ("You can't build a quad block here."); |
|
|
799 | } |
|
|
800 | } |
|
|
801 | |
695 | /** |
802 | /** |
696 | * Global building function |
803 | * Global building function |
697 | * |
804 | * |
698 | * This is the general map building function. Called when the player 'fires' a builder |
805 | * This is the general map building function. Called when the player 'fires' a builder |
699 | * or remover object. |
806 | * or remover object. |
700 | */ |
807 | */ |
701 | void |
808 | void |
702 | apply_map_builder (object *pl, int dir) |
809 | apply_map_builder (object *pl, int dir) |
703 | { |
810 | { |
704 | object *builder; |
|
|
705 | object *tmp; |
|
|
706 | object *tmp2; |
|
|
707 | int x, y; |
|
|
708 | |
|
|
709 | if (!pl->type == PLAYER) |
811 | if (!pl->type == PLAYER) |
710 | return; |
812 | return; |
711 | |
813 | |
712 | /*if ( !player->map->unique ) |
|
|
713 | { |
|
|
714 | new_draw_info( NDI_UNIQUE, 0, player, "You can't build outside a unique map." ); |
|
|
715 | return; |
|
|
716 | } */ |
|
|
717 | |
|
|
718 | if (dir == 0) |
814 | if (dir == 0) |
719 | { |
815 | { |
720 | new_draw_info (NDI_UNIQUE, 0, pl, "You can't build or destroy under yourself."); |
816 | new_draw_info (NDI_UNIQUE, 0, pl, "You can't build or destroy under yourself."); |
721 | return; |
817 | return; |
722 | } |
818 | } |
723 | |
819 | |
724 | x = pl->x + freearr_x[dir]; |
820 | mapxy pos (pl); pos.move (dir); |
725 | y = pl->y + freearr_y[dir]; |
|
|
726 | |
821 | |
727 | if ((1 > x) || (1 > y) || ((pl->map->width - 2) < x) || ((pl->map->height - 2) < y)) |
822 | if (!pos.normalise ()) |
728 | { |
823 | { |
729 | new_draw_info (NDI_UNIQUE, 0, pl, "Can't build on map edge..."); |
824 | pl->failmsg ("You can't build here. H<There is nothing in this direction.>"); |
730 | return; |
825 | return; |
731 | } |
826 | } |
732 | |
827 | |
733 | /* |
828 | /* |
734 | * Check specified square |
829 | * Check specified square |
735 | * The square must have only buildable items |
830 | * The square must have only buildable items |
736 | * Exception: marking runes are all right, |
831 | * Exception: marking runes are all right, |
737 | * since they are used for special things like connecting doors / buttons |
832 | * since they are used for special things like connecting doors / buttons |
738 | */ |
833 | */ |
739 | |
834 | |
740 | tmp = GET_MAP_OB (pl->map, x, y); |
835 | object *builder = pl->contr->ranged_ob; |
741 | if (!tmp) |
836 | |
742 | { |
837 | object *tmp2 = pl->mark (); |
743 | /* Nothing, meaning player is standing next to an undefined square... */ |
838 | |
744 | LOG (llevError, "apply_map_builder: undefined square at (%d, %d, %s)\n", x, y, &pl->map->path); |
839 | object *tmp = 0; |
745 | new_draw_info (NDI_UNIQUE, 0, pl, "You'd better not build here, it looks weird."); |
840 | for (tmp = pos.ms ().bot; tmp; tmp = tmp->above) |
746 | return; |
|
|
747 | } |
841 | { |
748 | |
842 | if (!tmp->flag [FLAG_IS_BUILDABLE] |
749 | if (INVOKE_PLAYER (BUILD, pl->contr, ARG_OBJECT (builder), ARG_MAP (pl->map), ARG_INT (x), ARG_INT (y))) |
|
|
750 | return; |
|
|
751 | |
|
|
752 | tmp2 = find_marked_object (pl); |
|
|
753 | while (tmp) |
|
|
754 | { |
|
|
755 | if (!QUERY_FLAG (tmp, FLAG_IS_BUILDABLE) && (tmp->type != SIGN || tmp->arch->archname != shstr_rune_mark)) |
843 | && (tmp->type != SIGN || tmp->arch->archname != shstr_rune_mark)) |
756 | { |
844 | { |
757 | /* The item building function already has it's own special |
845 | /* The item building function already has it's own special |
758 | * checks for this |
846 | * checks for this. And so does the quad building function. |
759 | */ |
847 | */ |
760 | if (!tmp2 || tmp2->subtype != ST_MAT_ITEM) |
848 | if (!tmp2 || (tmp2->subtype != ST_MAT_ITEM && tmp2->subtype != ST_MAT_QUAD)) |
761 | { |
849 | { |
|
|
850 | if (!INVOKE_PLAYER (BUILD, pl->contr, ARG_OBJECT (builder), |
|
|
851 | ARG_MAP (pl->map), |
|
|
852 | ARG_INT (pos.y), ARG_INT (pos.y), |
|
|
853 | ARG_INT (0))) |
762 | new_draw_info (NDI_UNIQUE, 0, pl, "You can't build here."); |
854 | new_draw_info (NDI_UNIQUE, 0, pl, "You can't build here."); |
|
|
855 | |
763 | return; |
856 | return; |
764 | } |
857 | } |
765 | } |
858 | } |
766 | |
|
|
767 | tmp = tmp->above; |
|
|
768 | } |
859 | } |
769 | |
860 | |
770 | /* Now we know the square is ok */ |
861 | /* Now we know the square is ok */ |
771 | builder = pl->contr->ranged_ob; |
862 | if (INVOKE_PLAYER (BUILD, pl->contr, ARG_OBJECT (builder), |
|
|
863 | ARG_MAP (pl->map), ARG_INT (pos.x), ARG_INT (pos.y), ARG_INT (1))) |
|
|
864 | return; |
772 | |
865 | |
773 | if (builder->subtype == ST_BD_REMOVE) |
866 | if (builder->subtype == ST_BD_REMOVE) |
774 | /* Remover -> call specific function and bail out */ |
867 | /* Remover -> call specific function and bail out */ |
775 | { |
868 | { |
776 | apply_builder_remove (pl, dir); |
869 | apply_builder_remove (pl, dir); |
… | |
… | |
797 | } |
890 | } |
798 | |
891 | |
799 | switch (tmp->subtype) |
892 | switch (tmp->subtype) |
800 | { |
893 | { |
801 | case ST_MAT_FLOOR: |
894 | case ST_MAT_FLOOR: |
802 | apply_builder_floor (pl, tmp, x, y); |
895 | apply_builder_floor (pl, tmp, pos.x, pos.y); |
803 | return; |
896 | return; |
804 | |
897 | |
805 | case ST_MAT_WALL: |
898 | case ST_MAT_WALL: |
806 | apply_builder_wall (pl, tmp, x, y); |
899 | apply_builder_wall (pl, tmp, pos.x, pos.y); |
807 | return; |
900 | return; |
808 | |
901 | |
809 | case ST_MAT_ITEM: |
902 | case ST_MAT_ITEM: |
810 | apply_builder_item (pl, tmp, x, y); |
903 | apply_builder_item (pl, tmp, pos.x, pos.y); |
|
|
904 | return; |
|
|
905 | |
|
|
906 | case ST_MAT_QUAD: |
|
|
907 | apply_builder_quad (pl, tmp, pos); |
811 | return; |
908 | return; |
812 | |
909 | |
813 | default: |
910 | default: |
814 | new_draw_info (NDI_UNIQUE, 0, pl, "Don't know how to apply this material, sorry."); |
911 | new_draw_info (NDI_UNIQUE, 0, pl, "Don't know how to apply this material, sorry."); |
815 | LOG (llevError, "apply_map_builder: invalid material subtype %d\n", tmp->subtype); |
912 | LOG (llevError, "apply_map_builder: invalid material subtype %d\n", tmp->subtype); |