1 | /* |
1 | /* |
2 | * static char *rcsid_map_c = |
2 | * static char *rcsid_map_c = |
3 | * "$Id: map.C,v 1.26 2006/09/07 09:37:12 pippijn Exp $"; |
3 | * "$Id: map.C,v 1.27 2006/09/08 12:56:42 root Exp $"; |
4 | */ |
4 | */ |
5 | |
5 | |
6 | /* |
6 | /* |
7 | CrossFire, A Multiplayer game for X-windows |
7 | CrossFire, A Multiplayer game for X-windows |
8 | |
8 | |
… | |
… | |
704 | number_of_entries++; |
704 | number_of_entries++; |
705 | if (p) p++; |
705 | if (p) p++; |
706 | } |
706 | } |
707 | p=shop_string; |
707 | p=shop_string; |
708 | strip_endline(p); |
708 | strip_endline(p); |
709 | items=(shopitems *) CALLOC(number_of_entries+1, sizeof(shopitems)); |
709 | items = new shopitems [number_of_entries + 1]; |
710 | memset(items, 0, (sizeof(shopitems) * number_of_entries+1)); |
|
|
711 | for (i=0; i<number_of_entries; i++) { |
710 | for (i=0; i<number_of_entries; i++) { |
712 | if (!p) { |
711 | if (!p) { |
713 | LOG(llevError, "parse_shop_string: I seem to have run out of string, that shouldn't happen.\n"); |
712 | LOG(llevError, "parse_shop_string: I seem to have run out of string, that shouldn't happen.\n"); |
714 | break; |
713 | break; |
715 | } |
714 | } |
… | |
… | |
1412 | if (flag && m->spaces) free_all_objects(m); |
1411 | if (flag && m->spaces) free_all_objects(m); |
1413 | if (m->name) FREE_AND_CLEAR(m->name); |
1412 | if (m->name) FREE_AND_CLEAR(m->name); |
1414 | if (m->spaces) FREE_AND_CLEAR(m->spaces); |
1413 | if (m->spaces) FREE_AND_CLEAR(m->spaces); |
1415 | if (m->msg) FREE_AND_CLEAR(m->msg); |
1414 | if (m->msg) FREE_AND_CLEAR(m->msg); |
1416 | if (m->maplore) FREE_AND_CLEAR(m->maplore); |
1415 | if (m->maplore) FREE_AND_CLEAR(m->maplore); |
1417 | if (m->shopitems) FREE_AND_CLEAR(m->shopitems); |
1416 | if (m->shopitems) delete [] m->shopitems; m->shopitems = 0; |
1418 | if (m->shoprace) FREE_AND_CLEAR(m->shoprace); |
1417 | if (m->shoprace) FREE_AND_CLEAR(m->shoprace); |
1419 | if (m->buttons) |
1418 | if (m->buttons) |
1420 | free_objectlinkpt(m->buttons); |
1419 | free_objectlinkpt(m->buttons); |
1421 | m->buttons = NULL; |
1420 | m->buttons = NULL; |
1422 | for (i=0; i<4; i++) { |
1421 | for (i=0; i<4; i++) { |