1 | /* |
1 | /* |
2 | * static char *rcsid_map_c = |
2 | * static char *rcsid_map_c = |
3 | * "$Id: map.C,v 1.11 2006/08/28 16:12:59 root Exp $"; |
3 | * "$Id: map.C,v 1.12 2006/08/28 16:52:51 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 | |
… | |
… | |
895 | * for compatibility reasons. The new values (second) are |
895 | * for compatibility reasons. The new values (second) are |
896 | * what really should be used. |
896 | * what really should be used. |
897 | */ |
897 | */ |
898 | else if (!strcmp(key,"oid")) { |
898 | else if (!strcmp(key,"oid")) { |
899 | fp.get (m, atoi(value)); |
899 | fp.get (m, atoi(value)); |
|
|
900 | } else if (!strcmp(key, "attach")) { |
|
|
901 | m->attach = add_string (value); |
900 | } else if (!strcmp(key,"hp") || !strcmp(key, "enter_x")) { |
902 | } else if (!strcmp(key,"hp") || !strcmp(key, "enter_x")) { |
901 | m->enter_x = atoi(value); |
903 | m->enter_x = atoi(value); |
902 | } else if (!strcmp(key,"sp") || !strcmp(key, "enter_y")) { |
904 | } else if (!strcmp(key,"sp") || !strcmp(key, "enter_y")) { |
903 | m->enter_y = atoi(value); |
905 | m->enter_y = atoi(value); |
904 | } else if (!strcmp(key,"x") || !strcmp(key, "width")) { |
906 | } else if (!strcmp(key,"x") || !strcmp(key, "width")) { |
… | |
… | |
1054 | close_and_delete(fp, comp); |
1056 | close_and_delete(fp, comp); |
1055 | m->in_memory=MAP_IN_MEMORY; |
1057 | m->in_memory=MAP_IN_MEMORY; |
1056 | if (!MAP_DIFFICULTY(m)) |
1058 | if (!MAP_DIFFICULTY(m)) |
1057 | MAP_DIFFICULTY(m)=calculate_difficulty(m); |
1059 | MAP_DIFFICULTY(m)=calculate_difficulty(m); |
1058 | set_map_reset_time(m); |
1060 | set_map_reset_time(m); |
1059 | INVOKE_MAP (INSTANTIATE, m); |
1061 | m->instantiate (); |
1060 | return (m); |
1062 | return (m); |
1061 | } |
1063 | } |
1062 | |
1064 | |
1063 | /* |
1065 | /* |
1064 | * Loads a map, which has been loaded earlier, from file. |
1066 | * Loads a map, which has been loaded earlier, from file. |
… | |
… | |
1336 | if (flag != 2) |
1338 | if (flag != 2) |
1337 | for (i = 0; i < 4; i++) |
1339 | for (i = 0; i < 4; i++) |
1338 | if (m->tile_path[i]) |
1340 | if (m->tile_path[i]) |
1339 | fprintf (fp, "tile_path_%d %s\n", i + 1, m->tile_path[i]); |
1341 | fprintf (fp, "tile_path_%d %s\n", i + 1, m->tile_path[i]); |
1340 | |
1342 | |
|
|
1343 | fp.put (m); |
1341 | fprintf (fp, "end\n"); |
1344 | fprintf (fp, "end\n"); |
1342 | |
1345 | |
1343 | /* In the game save unique items in the different file, but |
1346 | /* In the game save unique items in the different file, but |
1344 | * in the editor save them to the normal map file. |
1347 | * in the editor save them to the normal map file. |
1345 | * If unique map, save files in the proper destination (set by |
1348 | * If unique map, save files in the proper destination (set by |