1 | /* |
1 | /* |
2 | * static char *rcsid_map_c = |
2 | * static char *rcsid_map_c = |
3 | * "$Id: map.C,v 1.21 2006/09/03 22:45:55 root Exp $"; |
3 | * "$Id: map.C,v 1.23 2006/09/04 15:51:24 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 | |
… | |
… | |
800 | value = NULL; |
800 | value = NULL; |
801 | break; |
801 | break; |
802 | } |
802 | } |
803 | } |
803 | } |
804 | } |
804 | } |
|
|
805 | |
805 | if (!end) { |
806 | if (!end) { |
806 | LOG(llevError, "Error loading map header - did not find a newline - perhaps file is truncated? Buf=%s\n", |
807 | LOG(llevError, "Error loading map header - did not find a newline - perhaps file is truncated? Buf=%s\n", |
807 | buf); |
808 | buf); |
808 | return 1; |
809 | return 1; |
809 | } |
810 | } |
810 | |
|
|
811 | |
811 | |
812 | /* key is the field name, value is what it should be set |
812 | /* key is the field name, value is what it should be set |
813 | * to. We've already done the work to null terminate key, |
813 | * to. We've already done the work to null terminate key, |
814 | * and strip off any leading spaces for both of these. |
814 | * and strip off any leading spaces for both of these. |
815 | * We have not touched the newline at the end of the line - |
815 | * We have not touched the newline at the end of the line - |
… | |
… | |
995 | |
995 | |
996 | mapstruct *load_original_map(const char *filename, int flags) { |
996 | mapstruct *load_original_map(const char *filename, int flags) { |
997 | mapstruct *m; |
997 | mapstruct *m; |
998 | char pathname[MAX_BUF]; |
998 | char pathname[MAX_BUF]; |
999 | |
999 | |
1000 | LOG(llevDebug, "load_original_map: %s (%x)\n", filename,flags); |
|
|
1001 | if (flags & MAP_PLAYER_UNIQUE) |
1000 | if (flags & MAP_PLAYER_UNIQUE) |
1002 | strcpy(pathname, filename); |
1001 | strcpy(pathname, filename); |
1003 | else if (flags & MAP_OVERLAY) |
1002 | else if (flags & MAP_OVERLAY) |
1004 | strcpy(pathname, create_overlay_pathname(filename)); |
1003 | strcpy(pathname, create_overlay_pathname(filename)); |
1005 | else |
1004 | else |
1006 | strcpy(pathname, create_pathname(filename)); |
1005 | strcpy(pathname, create_pathname(filename)); |
|
|
1006 | |
|
|
1007 | LOG(llevDebug, "load_original_map(%x): %s (%s)\n", flags, filename, pathname); |
1007 | |
1008 | |
1008 | object_thawer thawer (pathname); |
1009 | object_thawer thawer (pathname); |
1009 | |
1010 | |
1010 | if (!thawer) |
1011 | if (!thawer) |
1011 | return 0; |
1012 | return 0; |