Changeset 3503 in orxonox.OLD for orxonox/branches/levelloader/src/story_entities/campaign.cc
- Timestamp:
- Mar 11, 2005, 6:44:55 PM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/branches/levelloader/src/story_entities/campaign.cc
r3501 r3503 21 21 #include "camera.h" 22 22 #include "story_entity.h" 23 #include "factory.h" 23 24 24 25 using namespace std; … … 36 37 { 37 38 TiXMLElement* element; 39 char string; 40 int id; 38 41 39 42 assert( root != NULL); … … 44 47 45 48 // grab all the necessary parameters 46 49 string = grabParameter( root, "identifier"); 50 if( string == NULL || if( sscanf(string, "%d", &id) != 1)) 51 { 52 PRINTF(ERR)("Campaign is missing a proper 'identifier'\n"); 53 setStoryId( -1); 54 } 55 else setStoryId( id); 56 47 57 // find WorldList 48 58 element = root->FirstChildElement( "WorldList"); 49 59 50 // load Worlds 60 // load Worlds/Subcampaigns/Whatever 51 61 while( element != NULL) 52 62 { 53 StoryEntity created =loader->fabricate( element);63 StoryEntity* created = (StoryEntity*) loader->fabricate( element); 54 64 if( created != NULL) addEntity( created); 55 65 element = element->nextSiblingElement();
Note: See TracChangeset
for help on using the changeset viewer.