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

Comparing deliantra/server/common/loader.C (file contents):
Revision 1.68 by root, Mon Apr 16 06:23:39 2007 UTC vs.
Revision 1.70 by root, Tue Apr 17 18:40:31 2007 UTC

1399 return true; 1399 return true;
1400} 1400}
1401 1401
1402///////////////////////////////////////////////////////////////////////////// 1402/////////////////////////////////////////////////////////////////////////////
1403 1403
1404// generic resource file load,
1405// currently supports: region, treasures, archetypes
1404bool load_resource_file (const char *filename) 1406bool load_resource_file (const char *filename)
1405{ 1407{
1406 object_thawer f (filename); 1408 object_thawer f (filename);
1409
1410 bool success = false;
1411 bool seen_arch = false;
1407 1412
1408 f.next (); 1413 f.next ();
1409 1414
1410 for (;;) 1415 for (;;)
1411 { 1416 {
1412 switch (f.kw) 1417 switch (f.kw)
1413 { 1418 {
1414 case KW_region: 1419 case KW_region:
1415 if (!region::read (f)) 1420 if (!region::read (f))
1416 return false; 1421 goto finish;
1422 break;
1423
1424 case KW_treasure:
1425 case KW_treasureone:
1426 if (!treasurelist::read (f))
1427 goto finish;
1428 break;
1429
1430 case KW_object:
1431 seen_arch = true;
1432 if (!archetype::read (f))
1433 goto finish;
1417 break; 1434 break;
1418 1435
1419 case KW_EOF: 1436 case KW_EOF:
1420 return true; 1437 success = true;
1438 goto finish;
1421 1439
1422 default: 1440 default:
1423 if (!f.parse_error ("resource file")) 1441 if (!f.parse_error ("resource file"))
1424 return false; 1442 goto finish;
1425 } 1443 }
1426
1427 f.next ();
1428 } 1444 }
1445
1446finish:
1447 if (seen_arch)
1448 init_archetype_pointers ();
1449
1450 return success;
1429} 1451}
1430 1452

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines