Changeset 7203 in orxonox.OLD for branches/std/src/story_entities/story_entity.cc
- Timestamp:
- Mar 9, 2006, 5:28:10 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/std/src/story_entities/story_entity.cc
r7193 r7203 40 40 this->isRunning = false; 41 41 42 this->loadFile = NULL;42 this->loadFile = ""; 43 43 this->storyID = -1; 44 44 this->description = NULL; … … 100 100 * @param name the name of the path 101 101 */ 102 void StoryEntity::setLoadFile(const char* fileName) 103 { 104 if (this->loadFile) 105 delete this->loadFile; 102 void StoryEntity::setLoadFile(const std::string& fileName) 103 { 106 104 if (ResourceManager::isFile(fileName)) 107 105 { 108 this->loadFile = new char[strlen(fileName)+1]; 109 strcpy(this->loadFile, fileName); 106 this->loadFile = fileName; 110 107 } 111 108 else … … 149 146 { 150 147 PRINTF(3)("Grabbing the Worlds Settings\n", this->getLoadFile()); 151 if( getLoadFile() == NULL)152 return;148 if( getLoadFile().empty()) 149 return; 153 150 TiXmlDocument XMLDoc(this->getLoadFile()); 154 151 // load the xml world file for further loading 155 152 if( !XMLDoc.LoadFile()) 156 153 { 157 PRINTF(1)("loading XML File: %s @ %s:l%d:c%d\n", XMLDoc.ErrorDesc(), this->getLoadFile() , XMLDoc.ErrorRow(), XMLDoc.ErrorCol());154 PRINTF(1)("loading XML File: %s @ %s:l%d:c%d\n", XMLDoc.ErrorDesc(), this->getLoadFile().c_str(), XMLDoc.ErrorRow(), XMLDoc.ErrorCol()); 158 155 return; 159 156 }
Note: See TracChangeset
for help on using the changeset viewer.