1 | /* |
1 | /* |
2 | * static char *rcsid_build_map = |
2 | * static char *rcsid_build_map = |
3 | * "$Id: build_map.C,v 1.2 2006/08/29 08:01:37 root Exp $"; |
3 | * "$Id: build_map.C,v 1.3 2006/09/03 00:18:42 root Exp $"; |
4 | */ |
4 | */ |
5 | /* |
5 | /* |
6 | CrossFire, A Multiplayer game for X-windows |
6 | CrossFire, A Multiplayer game for X-windows |
7 | |
7 | |
8 | Copyright (C) 2001 Mark Wedel & Crossfire Development Team |
8 | Copyright (C) 2001 Mark Wedel & Crossfire Development Team |
… | |
… | |
158 | } |
158 | } |
159 | |
159 | |
160 | force = get_archetype( FORCE_NAME ); |
160 | force = get_archetype( FORCE_NAME ); |
161 | force->speed = 0; |
161 | force->speed = 0; |
162 | update_ob_speed( force ); |
162 | update_ob_speed( force ); |
163 | force->slaying = add_string( pl->map->path ); |
163 | force->slaying = pl->map->path; |
164 | force->msg = add_string( rune->msg ); |
164 | force->msg = rune->msg; |
165 | force->path_attuned = connected; |
165 | force->path_attuned = connected; |
166 | insert_ob_in_ob( force, pl ); |
166 | insert_ob_in_ob( force, pl ); |
167 | |
167 | |
168 | return connected; |
168 | return connected; |
169 | } |
169 | } |
… | |
… | |
398 | /* Now insert our floor */ |
398 | /* Now insert our floor */ |
399 | new_floor = find_archetype( material->slaying ); |
399 | new_floor = find_archetype( material->slaying ); |
400 | if ( !new_floor ) |
400 | if ( !new_floor ) |
401 | { |
401 | { |
402 | /* Not found, log & bail out */ |
402 | /* Not found, log & bail out */ |
403 | LOG( llevError, "apply_builder_floor: unable to find archetype %s.\n", material->slaying ); |
403 | LOG( llevError, "apply_builder_floor: unable to find archetype %s.\n", &material->slaying ); |
404 | return; |
404 | return; |
405 | } |
405 | } |
406 | |
406 | |
407 | tmp = arch_to_object( new_floor ); |
407 | tmp = arch_to_object( new_floor ); |
408 | SET_FLAG( tmp, FLAG_IS_BUILDABLE ); |
408 | SET_FLAG( tmp, FLAG_IS_BUILDABLE ); |
… | |
… | |
491 | |
491 | |
492 | /* Now we can actually insert the wall */ |
492 | /* Now we can actually insert the wall */ |
493 | new_wall = find_archetype( material->slaying ); |
493 | new_wall = find_archetype( material->slaying ); |
494 | if ( !new_wall ) |
494 | if ( !new_wall ) |
495 | { |
495 | { |
496 | LOG( llevError, "apply_builder_wall: unable to find archetype %s\n", material->slaying ); |
496 | LOG( llevError, "apply_builder_wall: unable to find archetype %s\n", &material->slaying ); |
497 | return; |
497 | return; |
498 | } |
498 | } |
499 | |
499 | |
500 | tmp = arch_to_object( new_wall ); |
500 | tmp = arch_to_object( new_wall ); |
501 | tmp->type = WALL; |
501 | tmp->type = WALL; |
… | |
… | |
836 | new_draw_info( NDI_UNIQUE, 0, pl, "You need to put a book or scroll with the message." ); |
836 | new_draw_info( NDI_UNIQUE, 0, pl, "You need to put a book or scroll with the message." ); |
837 | return -1; |
837 | return -1; |
838 | } |
838 | } |
839 | |
839 | |
840 | tmp->msg = book->msg; |
840 | tmp->msg = book->msg; |
841 | add_refcount( tmp->msg ); |
|
|
842 | |
841 | |
843 | if (tmp->invisible) |
842 | if (tmp->invisible) |
844 | { |
843 | { |
845 | if(book->custom_name != NULL) |
844 | if(book->custom_name != NULL) |
846 | { |
845 | { |
847 | snprintf(buf, sizeof(buf), "talking %s", book->custom_name); |
846 | snprintf(buf, sizeof(buf), "talking %s", &book->custom_name); |
848 | } else { |
847 | } else { |
849 | snprintf(buf, sizeof(buf), "talking %s", book->name); |
848 | snprintf(buf, sizeof(buf), "talking %s", &book->name); |
850 | } |
849 | } |
851 | if ( tmp->name ) |
|
|
852 | free_string( tmp->name ); |
|
|
853 | tmp->name = add_string( buf ); |
850 | tmp->name = buf; |
854 | |
851 | |
855 | if(book->name_pl != NULL) |
852 | if (book->name_pl != NULL) |
856 | { |
853 | { |
857 | snprintf(buf2, sizeof(buf2), "talking %s", book->name_pl); |
854 | snprintf(buf2, sizeof(buf2), "talking %s", &book->name_pl); |
858 | if ( tmp->name_pl ) |
|
|
859 | free_string( tmp->name_pl ); |
|
|
860 | tmp->name_pl = add_string( buf2 ); |
855 | tmp->name_pl = buf2; |
861 | } |
856 | } |
862 | |
857 | |
863 | tmp->face = book->face; |
858 | tmp->face = book->face; |
864 | tmp->invisible = 0; |
859 | tmp->invisible = 0; |
865 | } |
860 | } |
866 | remove_ob( book ); |
861 | remove_ob( book ); |