ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/common/map.C
(Generate patch)

Comparing deliantra/server/common/map.C (file contents):
Revision 1.16 by root, Wed Aug 30 16:30:37 2006 UTC vs.
Revision 1.24 by root, Mon Sep 4 16:46:32 2006 UTC

1/* 1/*
2 * static char *rcsid_map_c = 2 * static char *rcsid_map_c =
3 * "$Id: map.C,v 1.16 2006/08/30 16:30:37 root Exp $"; 3 * "$Id: map.C,v 1.24 2006/09/04 16:46:32 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
482 op->x += tmp->x; 482 op->x += tmp->x;
483 op->y += tmp->y; 483 op->y += tmp->y;
484 op->head = tmp; 484 op->head = tmp;
485 op->map = m; 485 op->map = m;
486 last->more = op; 486 last->more = op;
487 if (tmp->name != op->name) {
488 if (op->name) free_string(op->name);
489 op->name = add_string(tmp->name); 487 op->name = tmp->name;
490 }
491 if (tmp->title != op->title) {
492 if (op->title) free_string(op->title);
493 op->title = add_string(tmp->title); 488 op->title = tmp->title;
494 }
495 /* we could link all the parts onto tmp, and then just 489 /* we could link all the parts onto tmp, and then just
496 * call insert_ob_in_map once, but the effect is the same, 490 * call insert_ob_in_map once, but the effect is the same,
497 * as insert_ob_in_map will call itself with each part, and 491 * as insert_ob_in_map will call itself with each part, and
498 * the coding is simpler to just to it here with each part. 492 * the coding is simpler to just to it here with each part.
499 */ 493 */
500 insert_ob_in_map(op, op->map, tmp,INS_NO_MERGE|INS_ABOVE_FLOOR_ONLY|INS_NO_WALK_ON); 494 insert_ob_in_map(op, op->map, tmp,INS_NO_MERGE|INS_ABOVE_FLOOR_ONLY|INS_NO_WALK_ON);
501 } /* for at = tmp->arch->more */ 495 } /* for at = tmp->arch->more */
502 } /* for objects on this space */ 496 } /* for objects on this space */
503} 497}
504 498
505
506
507/* 499/*
508 * Loads (ands parses) the objects into a given map from the specified 500 * Loads (ands parses) the objects into a given map from the specified
509 * file pointer. 501 * file pointer.
510 * mapflags is the same as we get with load_original_map 502 * mapflags is the same as we get with load_original_map
511 */ 503 */
512 504void
513void load_objects (mapstruct *m, object_thawer &fp, int mapflags) { 505load_objects (mapstruct *m, object_thawer &fp, int mapflags)
514 int i,j,bufstate=LO_NEWFILE; 506{
507 int i, j;
515 int unique; 508 int unique;
516 object *op, *prev=NULL,*last_more=NULL, *otmp; 509 object *op, *prev = NULL, *last_more = NULL, *otmp;
517 510
518 op=get_object(); 511 op = get_object ();
519 op->map = m; /* To handle buttons correctly */ 512 op->map = m; /* To handle buttons correctly */
520 513
521 while((i = load_object (fp, op, bufstate, mapflags))) { 514 while ((i = load_object (fp, op, mapflags)))
522 /* Since the loading of the map header does not load an object 515 {
523 * anymore, we need to pass LO_NEWFILE for the first object loaded,
524 * and then switch to LO_REPEAT for faster loading.
525 */
526 bufstate = LO_REPEAT;
527
528 /* if the archetype for the object is null, means that we 516 /* if the archetype for the object is null, means that we
529 * got an invalid object. Don't do anything with it - the game 517 * got an invalid object. Don't do anything with it - the game
530 * or editor will not be able to do anything with it either. 518 * or editor will not be able to do anything with it either.
531 */ 519 */
532 if (op->arch==NULL) { 520 if (op->arch == NULL)
521 {
533 LOG(llevDebug,"Discarding object without arch: %s\n", op->name?op->name:"(null)"); 522 LOG (llevDebug, "Discarding object without arch: %s\n",
523 op->name ? (const char *) op->name : "(null)");
534 continue; 524 continue;
525 }
526
527
528 switch (i)
535 } 529 {
536
537
538 switch(i) {
539 case LL_NORMAL: 530 case LL_NORMAL:
540 /* if we are loading an overlay, put the floors on the bottom */ 531 /* if we are loading an overlay, put the floors on the bottom */
541 if ((QUERY_FLAG(op, FLAG_IS_FLOOR) || 532 if ((QUERY_FLAG (op, FLAG_IS_FLOOR) ||
542 QUERY_FLAG(op, FLAG_OVERLAY_FLOOR)) && mapflags & MAP_OVERLAY) 533 QUERY_FLAG (op, FLAG_OVERLAY_FLOOR)) && mapflags & MAP_OVERLAY)
543 insert_ob_in_map(op,m,op,INS_NO_MERGE | INS_NO_WALK_ON | INS_ABOVE_FLOOR_ONLY | INS_MAP_LOAD); 534 insert_ob_in_map (op, m, op,
535 INS_NO_MERGE | INS_NO_WALK_ON |
536 INS_ABOVE_FLOOR_ONLY | INS_MAP_LOAD);
544 else 537 else
545 insert_ob_in_map(op,m,op,INS_NO_MERGE | INS_NO_WALK_ON | INS_ON_TOP | INS_MAP_LOAD); 538 insert_ob_in_map (op, m, op,
539 INS_NO_MERGE | INS_NO_WALK_ON | INS_ON_TOP |
540 INS_MAP_LOAD);
546 541
547 if (op->inv) 542 if (op->inv)
548 sum_weight(op); 543 sum_weight (op);
549 544
550 prev=op,last_more=op; 545 prev = op, last_more = op;
551 break; 546 break;
552 547
553 case LL_MORE: 548 case LL_MORE:
554 insert_ob_in_map(op,m, op, INS_NO_MERGE | INS_NO_WALK_ON | INS_ABOVE_FLOOR_ONLY); 549 insert_ob_in_map (op, m, op,
550 INS_NO_MERGE | INS_NO_WALK_ON |
551 INS_ABOVE_FLOOR_ONLY);
555 op->head=prev,last_more->more=op,last_more=op; 552 op->head = prev, last_more->more = op, last_more = op;
556 break; 553 break;
557 } 554 }
555
558 if (mapflags & MAP_STYLE) { 556 if (mapflags & MAP_STYLE)
559 remove_from_active_list(op); 557 remove_from_active_list (op);
560 } 558
561 op=get_object(); 559 op = get_object ();
562 op->map = m; 560 op->map = m;
563 } 561 }
562
564 for (i=0;i<m->width;i++){ 563 for (i = 0; i < m->width; i++)
564 {
565 for (j=0;j<m->height;j++){ 565 for (j = 0; j < m->height; j++)
566 {
566 unique =0; 567 unique = 0;
567 /* check for unique items, or unique squares */ 568 /* check for unique items, or unique squares */
568 for (otmp = get_map_ob(m, i, j); otmp; otmp = otmp->above) { 569 for (otmp = get_map_ob (m, i, j); otmp; otmp = otmp->above)
569 if (QUERY_FLAG(otmp, FLAG_UNIQUE) || QUERY_FLAG(otmp, FLAG_OBJ_SAVE_ON_OVL)) 570 {
571 if (QUERY_FLAG (otmp, FLAG_UNIQUE)
572 || QUERY_FLAG (otmp, FLAG_OBJ_SAVE_ON_OVL))
570 unique = 1; 573 unique = 1;
571 if (!(mapflags & (MAP_OVERLAY|MAP_PLAYER_UNIQUE) || unique)) 574 if (!(mapflags & (MAP_OVERLAY | MAP_PLAYER_UNIQUE) || unique))
572 SET_FLAG(otmp, FLAG_OBJ_ORIGINAL); 575 SET_FLAG (otmp, FLAG_OBJ_ORIGINAL);
573 } 576 }
574 } 577 }
575 } 578 }
579
576 free_object(op); 580 free_object (op);
577 link_multipart_objects(m); 581 link_multipart_objects (m);
578} 582}
579 583
580/* This saves all the objects on the map in a non destructive fashion. 584/* This saves all the objects on the map in a non destructive fashion.
581 * Modified by MSW 2001-07-01 to do in a single pass - reduces code, 585 * Modified by MSW 2001-07-01 to do in a single pass - reduces code,
582 * and we only save the head of multi part objects - this is needed 586 * and we only save the head of multi part objects - this is needed
618 * Modified to no longer take a path option which was not being 622 * Modified to no longer take a path option which was not being
619 * used anyways. MSW 2001-07-01 623 * used anyways. MSW 2001-07-01
620 */ 624 */
621 625
622mapstruct *get_linked_map(void) { 626mapstruct *get_linked_map(void) {
623 mapstruct *map=(mapstruct *) calloc(1,sizeof(mapstruct)); 627 mapstruct *map = new mapstruct;
624 mapstruct *mp; 628 mapstruct *mp;
625
626 if(map==NULL)
627 fatal(OUT_OF_MEMORY);
628 629
629 for(mp=first_map;mp!=NULL&&mp->next!=NULL;mp=mp->next); 630 for(mp=first_map;mp!=NULL&&mp->next!=NULL;mp=mp->next);
630 if(mp==NULL) 631 if(mp==NULL)
631 first_map=map; 632 first_map=map;
632 else 633 else
815 value = NULL; 816 value = NULL;
816 break; 817 break;
817 } 818 }
818 } 819 }
819 } 820 }
821
820 if (!end) { 822 if (!end) {
821 LOG(llevError, "Error loading map header - did not find a newline - perhaps file is truncated? Buf=%s\n", 823 LOG(llevError, "Error loading map header - did not find a newline - perhaps file is truncated? Buf=%s\n",
822 buf); 824 buf);
823 return 1; 825 return 1;
824 } 826 }
825
826 827
827 /* key is the field name, value is what it should be set 828 /* key is the field name, value is what it should be set
828 * to. We've already done the work to null terminate key, 829 * to. We've already done the work to null terminate key,
829 * and strip off any leading spaces for both of these. 830 * and strip off any leading spaces for both of these.
830 * We have not touched the newline at the end of the line - 831 * We have not touched the newline at the end of the line -
888 * what really should be used. 889 * what really should be used.
889 */ 890 */
890 else if (!strcmp(key,"oid")) { 891 else if (!strcmp(key,"oid")) {
891 fp.get (m, atoi(value)); 892 fp.get (m, atoi(value));
892 } else if (!strcmp(key, "attach")) { 893 } else if (!strcmp(key, "attach")) {
893 m->attach = add_string (value); 894 m->attach = value;
894 } else if (!strcmp(key,"hp") || !strcmp(key, "enter_x")) { 895 } else if (!strcmp(key,"hp") || !strcmp(key, "enter_x")) {
895 m->enter_x = atoi(value); 896 m->enter_x = atoi(value);
896 } else if (!strcmp(key,"sp") || !strcmp(key, "enter_y")) { 897 } else if (!strcmp(key,"sp") || !strcmp(key, "enter_y")) {
897 m->enter_y = atoi(value); 898 m->enter_y = atoi(value);
898 } else if (!strcmp(key,"x") || !strcmp(key, "width")) { 899 } else if (!strcmp(key,"x") || !strcmp(key, "width")) {
1010 1011
1011mapstruct *load_original_map(const char *filename, int flags) { 1012mapstruct *load_original_map(const char *filename, int flags) {
1012 mapstruct *m; 1013 mapstruct *m;
1013 char pathname[MAX_BUF]; 1014 char pathname[MAX_BUF];
1014 1015
1015 LOG(llevDebug, "load_original_map: %s (%x)\n", filename,flags);
1016 if (flags & MAP_PLAYER_UNIQUE) 1016 if (flags & MAP_PLAYER_UNIQUE)
1017 strcpy(pathname, filename); 1017 strcpy(pathname, filename);
1018 else if (flags & MAP_OVERLAY) 1018 else if (flags & MAP_OVERLAY)
1019 strcpy(pathname, create_overlay_pathname(filename)); 1019 strcpy(pathname, create_overlay_pathname(filename));
1020 else 1020 else
1021 strcpy(pathname, create_pathname(filename)); 1021 strcpy(pathname, create_pathname(filename));
1022
1023 LOG(llevDebug, "load_original_map(%x): %s (%s)\n", flags, filename, pathname);
1022 1024
1023 object_thawer thawer (pathname); 1025 object_thawer thawer (pathname);
1024 1026
1025 if (!thawer) 1027 if (!thawer)
1026 return 0; 1028 return 0;
1179 return; 1181 return;
1180 1182
1181 m->in_memory=MAP_LOADING; 1183 m->in_memory=MAP_LOADING;
1182 if (m->tmpname == NULL) /* if we have loaded unique items from */ 1184 if (m->tmpname == NULL) /* if we have loaded unique items from */
1183 delete_unique_items(m); /* original map before, don't duplicate them */ 1185 delete_unique_items(m); /* original map before, don't duplicate them */
1184 load_object(thawer, NULL, LO_NOREAD,0);
1185 load_objects (m, thawer, 0); 1186 load_objects (m, thawer, 0);
1186 1187
1187 m->in_memory=MAP_IN_MEMORY; 1188 m->in_memory=MAP_IN_MEMORY;
1188} 1189}
1189 1190
1225 } 1226 }
1226 else 1227 else
1227 { 1228 {
1228 if (!m->tmpname) 1229 if (!m->tmpname)
1229 m->tmpname = tempnam_local (settings.tmpdir, NULL); 1230 m->tmpname = tempnam_local (settings.tmpdir, NULL);
1231
1230 strcpy (filename, m->tmpname); 1232 strcpy (filename, m->tmpname);
1231 } 1233 }
1232 1234
1233 LOG (llevDebug, "Saving map %s to %s\n", m->path, filename); 1235 LOG (llevDebug, "Saving map %s to %s\n", m->path, filename);
1234 m->in_memory = MAP_SAVING; 1236 m->in_memory = MAP_SAVING;
1235 1237
1236 object_freezer fp (filename); 1238 object_freezer freezer;
1237 1239
1238 /* legacy */ 1240 /* legacy */
1239 fprintf (fp, "arch map\n"); 1241 fprintf (freezer, "arch map\n");
1240 if (m->name) 1242 if (m->name)
1241 fprintf (fp, "name %s\n", m->name); 1243 fprintf (freezer, "name %s\n", m->name);
1242 if (!flag) 1244 if (!flag)
1243 fprintf (fp, "swap_time %d\n", m->swap_time); 1245 fprintf (freezer, "swap_time %d\n", m->swap_time);
1244 if (m->reset_timeout) 1246 if (m->reset_timeout)
1245 fprintf (fp, "reset_timeout %d\n", m->reset_timeout); 1247 fprintf (freezer, "reset_timeout %d\n", m->reset_timeout);
1246 if (m->fixed_resettime) 1248 if (m->fixed_resettime)
1247 fprintf (fp, "fixed_resettime %d\n", m->fixed_resettime); 1249 fprintf (freezer, "fixed_resettime %d\n", m->fixed_resettime);
1248 /* we unfortunately have no idea if this is a value the creator set 1250 /* we unfortunately have no idea if this is a value the creator set
1249 * or a difficulty value we generated when the map was first loaded 1251 * or a difficulty value we generated when the map was first loaded
1250 */ 1252 */
1251 if (m->difficulty) 1253 if (m->difficulty)
1252 fprintf (fp, "difficulty %d\n", m->difficulty); 1254 fprintf (freezer, "difficulty %d\n", m->difficulty);
1253 if (m->region) 1255 if (m->region)
1254 fprintf (fp, "region %s\n", m->region->name); 1256 fprintf (freezer, "region %s\n", m->region->name);
1255 if (m->shopitems) 1257 if (m->shopitems)
1256 { 1258 {
1257 print_shop_string (m, shop); 1259 print_shop_string (m, shop);
1258 fprintf (fp, "shopitems %s\n", shop); 1260 fprintf (freezer, "shopitems %s\n", shop);
1259 } 1261 }
1260 if (m->shopgreed) 1262 if (m->shopgreed)
1261 fprintf (fp, "shopgreed %f\n", m->shopgreed); 1263 fprintf (freezer, "shopgreed %f\n", m->shopgreed);
1262#ifndef WIN32 1264#ifndef WIN32
1263 if (m->shopmin) 1265 if (m->shopmin)
1264 fprintf (fp, "shopmin %llu\n", m->shopmin); 1266 fprintf (freezer, "shopmin %llu\n", m->shopmin);
1265 if (m->shopmax) 1267 if (m->shopmax)
1266 fprintf (fp, "shopmax %llu\n", m->shopmax); 1268 fprintf (freezer, "shopmax %llu\n", m->shopmax);
1267#else 1269#else
1268 if (m->shopmin) 1270 if (m->shopmin)
1269 fprintf (fp, "shopmin %I64u\n", m->shopmin); 1271 fprintf (freezer, "shopmin %I64u\n", m->shopmin);
1270 if (m->shopmax) 1272 if (m->shopmax)
1271 fprintf (fp, "shopmax %I64u\n", m->shopmax); 1273 fprintf (freezer, "shopmax %I64u\n", m->shopmax);
1272#endif 1274#endif
1273 if (m->shoprace) 1275 if (m->shoprace)
1274 fprintf (fp, "shoprace %s\n", m->shoprace); 1276 fprintf (freezer, "shoprace %s\n", m->shoprace);
1275 if (m->darkness) 1277 if (m->darkness)
1276 fprintf (fp, "darkness %d\n", m->darkness); 1278 fprintf (freezer, "darkness %d\n", m->darkness);
1277 if (m->width) 1279 if (m->width)
1278 fprintf (fp, "width %d\n", m->width); 1280 fprintf (freezer, "width %d\n", m->width);
1279 if (m->height) 1281 if (m->height)
1280 fprintf (fp, "height %d\n", m->height); 1282 fprintf (freezer, "height %d\n", m->height);
1281 if (m->enter_x) 1283 if (m->enter_x)
1282 fprintf (fp, "enter_x %d\n", m->enter_x); 1284 fprintf (freezer, "enter_x %d\n", m->enter_x);
1283 if (m->enter_y) 1285 if (m->enter_y)
1284 fprintf (fp, "enter_y %d\n", m->enter_y); 1286 fprintf (freezer, "enter_y %d\n", m->enter_y);
1285 if (m->msg) 1287 if (m->msg)
1286 fprintf (fp, "msg\n%sendmsg\n", m->msg); 1288 fprintf (freezer, "msg\n%sendmsg\n", m->msg);
1287 if (m->maplore) 1289 if (m->maplore)
1288 fprintf (fp, "maplore\n%sendmaplore\n", m->maplore); 1290 fprintf (freezer, "maplore\n%sendmaplore\n", m->maplore);
1289 if (m->unique) 1291 if (m->unique)
1290 fprintf (fp, "unique %d\n", m->unique); 1292 fprintf (freezer, "unique %d\n", m->unique);
1291 if (m->templatemap) 1293 if (m->templatemap)
1292 fprintf (fp, "template %d\n", m->templatemap); 1294 fprintf (freezer, "template %d\n", m->templatemap);
1293 if (m->outdoor) 1295 if (m->outdoor)
1294 fprintf (fp, "outdoor %d\n", m->outdoor); 1296 fprintf (freezer, "outdoor %d\n", m->outdoor);
1295 if (m->temp) 1297 if (m->temp)
1296 fprintf (fp, "temp %d\n", m->temp); 1298 fprintf (freezer, "temp %d\n", m->temp);
1297 if (m->pressure) 1299 if (m->pressure)
1298 fprintf (fp, "pressure %d\n", m->pressure); 1300 fprintf (freezer, "pressure %d\n", m->pressure);
1299 if (m->humid) 1301 if (m->humid)
1300 fprintf (fp, "humid %d\n", m->humid); 1302 fprintf (freezer, "humid %d\n", m->humid);
1301 if (m->windspeed) 1303 if (m->windspeed)
1302 fprintf (fp, "windspeed %d\n", m->windspeed); 1304 fprintf (freezer, "windspeed %d\n", m->windspeed);
1303 if (m->winddir) 1305 if (m->winddir)
1304 fprintf (fp, "winddir %d\n", m->winddir); 1306 fprintf (freezer, "winddir %d\n", m->winddir);
1305 if (m->sky) 1307 if (m->sky)
1306 fprintf (fp, "sky %d\n", m->sky); 1308 fprintf (freezer, "sky %d\n", m->sky);
1307 if (m->nosmooth) 1309 if (m->nosmooth)
1308 fprintf (fp, "nosmooth %d\n", m->nosmooth); 1310 fprintf (freezer, "nosmooth %d\n", m->nosmooth);
1309 1311
1310 /* Save any tiling information, except on overlays */ 1312 /* Save any tiling information, except on overlays */
1311 if (flag != 2) 1313 if (flag != 2)
1312 for (i = 0; i < 4; i++) 1314 for (i = 0; i < 4; i++)
1313 if (m->tile_path[i]) 1315 if (m->tile_path[i])
1314 fprintf (fp, "tile_path_%d %s\n", i + 1, m->tile_path[i]); 1316 fprintf (freezer, "tile_path_%d %s\n", i + 1, m->tile_path[i]);
1315 1317
1316 fp.put (m); 1318 freezer.put (m);
1317 fprintf (fp, "end\n"); 1319 fprintf (freezer, "end\n");
1318 1320
1319 /* In the game save unique items in the different file, but 1321 /* In the game save unique items in the different file, but
1320 * in the editor save them to the normal map file. 1322 * in the editor save them to the normal map file.
1321 * If unique map, save files in the proper destination (set by 1323 * If unique map, save files in the proper destination (set by
1322 * player) 1324 * player)
1323 */ 1325 */
1324 if ((flag == 0 || flag == 2) && !m->unique && !m->templatemap) 1326 if ((flag == 0 || flag == 2) && !m->unique && !m->templatemap)
1325 { 1327 {
1328 object_freezer unique;
1329
1330 if (flag == 2)
1331 save_objects (m, freezer, unique, 2);
1332 else
1333 save_objects (m, freezer, unique, 0);
1334
1326 sprintf (buf, "%s.v00", create_items_path (m->path)); 1335 sprintf (buf, "%s.v00", create_items_path (m->path));
1327 1336
1328 object_freezer fp2 (buf); 1337 unique.save (buf);
1329
1330 if (flag == 2)
1331 save_objects (m, fp, fp2, 2);
1332 else
1333 save_objects (m, fp, fp2, 0);
1334 } 1338 }
1335 else 1339 else
1336 { /* save same file when not playing, like in editor */ 1340 { /* save same file when not playing, like in editor */
1337 save_objects (m, fp, fp, 0); 1341 save_objects (m, freezer, freezer, 0);
1338 } 1342 }
1343
1344 freezer.save (filename);
1339 1345
1340 return 0; 1346 return 0;
1341} 1347}
1342 1348
1343 1349
1388 clean_object(op); 1394 clean_object(op);
1389 remove_ob(op); 1395 remove_ob(op);
1390 free_object(op); 1396 free_object(op);
1391 } 1397 }
1392 } 1398 }
1393#ifdef MANY_CORES
1394 /* I see periodic cores on metalforge where a map has been swapped out, but apparantly
1395 * an item on that map was not saved - look for that condition and die as appropriate -
1396 * this leaves more of the map data intact for better debugging.
1397 */
1398 for (op=objects; op!=NULL; op=op->next) {
1399 if (!QUERY_FLAG(op, FLAG_REMOVED) && op->map == m) {
1400 LOG(llevDebug,"free_all_objects: object %s still on map after it should have been freed\n", op->name);
1401 abort();
1402 }
1403 }
1404#endif
1405} 1399}
1406 1400
1407/* 1401/*
1408 * Frees everything allocated by the given mapstructure. 1402 * Frees everything allocated by the given mapstructure.
1409 * don't free tmpname - our caller is left to do that 1403 * don't free tmpname - our caller is left to do that
1489 m->path); 1483 m->path);
1490 } 1484 }
1491 else 1485 else
1492 last->next = m->next; 1486 last->next = m->next;
1493 1487
1494 free (m); 1488 delete m;
1495} 1489}
1496 1490
1497 1491
1498 1492
1499/* 1493/*
1542 if (flags & MAP_PLAYER_UNIQUE) 1536 if (flags & MAP_PLAYER_UNIQUE)
1543 LOG(llevDebug, "Trying to load map %s.\n", name); 1537 LOG(llevDebug, "Trying to load map %s.\n", name);
1544 else 1538 else
1545 LOG(llevDebug, "Trying to load map %s.\n", create_pathname(name)); 1539 LOG(llevDebug, "Trying to load map %s.\n", create_pathname(name));
1546 1540
1541 //0.427459955215454 /var/crossfire/players/Saladon/_scorn_apartment_apartments
1542 //0.414906024932861
1543 //0.427063941955566
1544 eval_pv ("$x = Event::time", 1);//D
1547 if (!(m = load_original_map(name, (flags & MAP_PLAYER_UNIQUE)))) 1545 if (!(m = load_original_map(name, (flags & MAP_PLAYER_UNIQUE))))
1548 return (NULL); 1546 return (NULL);
1547 eval_pv ("warn \"LOAD \", Event::time - $x", 1);//D
1549 1548
1550 fix_auto_apply(m); /* Chests which open as default */ 1549 fix_auto_apply(m); /* Chests which open as default */
1551 1550
1552 /* If a player unique map, no extra unique object file to load. 1551 /* If a player unique map, no extra unique object file to load.
1553 * if from the editor, likewise. 1552 * if from the editor, likewise.
1554 */ 1553 */
1555 if (! (flags & (MAP_FLUSH|MAP_PLAYER_UNIQUE))) 1554 if (!(flags & (MAP_FLUSH|MAP_PLAYER_UNIQUE)))
1556 load_unique_objects(m); 1555 load_unique_objects(m);
1557 1556
1558 if (! (flags & (MAP_FLUSH|MAP_PLAYER_UNIQUE|MAP_OVERLAY))) { 1557 if (! (flags & (MAP_FLUSH|MAP_PLAYER_UNIQUE|MAP_OVERLAY))) {
1559 m=load_overlay_map(name, m); 1558 m=load_overlay_map(name, m);
1560 if (m==NULL) 1559 if (m==NULL)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines