- Timestamp:
- Mar 15, 2005, 6:01:21 PM (20 years ago)
- Location:
- orxonox/branches/levelloader/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/branches/levelloader/src/lib/util/substring.cc
r3530 r3562 34 34 strings = new char*[n]; 35 35 36 assert( strings != NULL); 37 36 38 int i = 0; 37 39 int l = 0; … … 41 43 while( end != NULL) 42 44 { 45 assert( i < n); 43 46 l = end - offset; 44 47 strings[i] = new char[l + 1]; 48 assert( strings[i] != NULL); 45 49 strncpy( strings[i], offset, l); 50 strings[i][l] = 0; 46 51 i++; 47 52 end++; 48 53 offset = end; 49 end = strchr( string, ',');54 end = strchr( offset, ','); 50 55 } 51 56 52 57 strings[i] = new char[l + 1]; 58 l = strlen( offset); 53 59 strncpy( strings[i], offset, l); 54 l = strlen( offset);60 strings[i][l] = 0; 55 61 } 56 62 -
orxonox/branches/levelloader/src/track_manager.cc
r3557 r3562 192 192 for (int i=0; i<childCount; i++) 193 193 { 194 if( names != NULL) 195 { 196 if( this->findTrackElementByName( names->getString(i))) 197 { 198 PRINTF(1)("Track name '%s' already taken", names->getString(i)); 199 } 200 } 201 194 202 195 this->currentTrackElem->children[i] = new TrackElement(); 203 196 this->currentTrackElem->children[i]->ID = ++trackElemCount; 204 197 this->currentTrackElem->children[i]->startingTime = this->currentTrackElem->endTime + this->currentTrackElem->jumpTime; 205 198 this->addPoint(this->currentTrackElem->curve->getNode(this->currentTrackElem->curve->getNodeCount()), this->currentTrackElem->children[i]); 206 } 199 if( names != NULL) 200 { 201 // todo check for duplicate track names to avoid confusion 202 /*if( this->findTrackElementByName( names->getString(i)) != NULL) 203 PRINTF0("Track name '%s' already taken", names->getString(i)); 204 else*/ 205 this->currentTrackElem->children[i]->setName( names->getString(i)); 206 } 207 208 } 207 209 } 208 210 … … 377 379 printf("Forking with %d children\n", count); 378 380 if (this->currentTrackElem->isSavePoint) 381 { 382 PRINTF0("Cannot fork a SavePoint - skipped\n"); 379 383 return; 384 } 380 385 this->currentTrackElem->isFork = true; 381 386 this->currentTrackElem->isHotPoint = true;
Note: See TracChangeset
for help on using the changeset viewer.