Changeset 3994 in orxonox.OLD for orxonox/branches/ll2trunktemp/src/story_entities/world.cc
- Timestamp:
- Apr 27, 2005, 1:50:23 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/branches/ll2trunktemp/src/story_entities/world.cc
r3992 r3994 120 120 this->constuctorInit("", -1); 121 121 122 const char *string; 123 char *name; 124 int id; 125 126 PRINTF0("Creating a World\n"); 127 128 // identifier 129 string = grabParameter( root, "identifier"); 130 if( string == NULL || sscanf(string, "%d", &id) != 1) 131 { 132 PRINTF0("World is missing a proper 'identifier'\n"); 133 this->setStoryID( -1); 134 } 135 else setStoryID( id); 136 137 // path 138 string = grabParameter( root, "path"); 139 if( string == NULL) 140 { 141 PRINTF0("World is missing a proper 'path'\n"); 142 this->setPath( NULL); 143 } 144 else 145 { 146 name = new char[strlen(string + 2)]; 147 strcpy( name, string); 148 this->setPath( name); 149 } 122 const char *string; 123 char *name; 124 int id; 125 126 PRINTF0("Creating a World\n"); 127 128 // identifier 129 string = grabParameter( root, "identifier"); 130 if( string == NULL || sscanf(string, "%d", &id) != 1) 131 { 132 PRINTF0("World is missing a proper 'identifier'\n"); 133 this->setStoryID( -1); 134 } 135 else setStoryID( id); 136 137 // next id 138 string = grabParameter( root, "nextid"); 139 if( string == NULL || sscanf(string, "%d", &id) != 1) 140 { 141 PRINTF0("World is missing a proper 'nextid'\n"); 142 this->setStoryID( -1); 143 } 144 else setNextStoryID( id); 145 146 147 // path 148 string = grabParameter( root, "path"); 149 if( string == NULL) 150 { 151 PRINTF0("World is missing a proper 'path'\n"); 152 this->setPath( NULL); 153 } 154 else 155 { 156 name = new char[strlen(string + 2)]; 157 strcpy( name, string); 158 this->setPath( name); 159 } 150 160 151 161 this->localPlayer = NULL;
Note: See TracChangeset
for help on using the changeset viewer.