Changeset 6095 in orxonox.OLD for branches/network/src/story_entities
- Timestamp:
- Dec 14, 2005, 1:39:37 AM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/network/src/story_entities/network_world.cc
r6093 r6095 341 341 // find WorldEntities // 342 342 //////////////////////// 343 element = root->FirstChildElement("WorldEntities"); 344 if( element == NULL) 343 if( NetworkManager::getInstance()->isGameServer()) 344 { 345 element = root->FirstChildElement("WorldEntities"); 346 if( element == NULL) 345 347 { 346 348 PRINTF(1)("NetworkWorld is missing 'WorldEntities'\n"); 347 349 } 348 else350 else 349 351 { 350 352 element = element->FirstChildElement(); … … 352 354 PRINTF(4)("Loading NetworkWorldEntities\n"); 353 355 while( element != NULL) 356 { 357 BaseObject* created = Factory::fabricate(element); 358 if( created != NULL ) 354 359 { 355 BaseObject* created = Factory::fabricate(element); 356 if( created != NULL ) 357 { 358 if(created->isA(CL_WORLD_ENTITY)) 359 this->spawn(dynamic_cast<WorldEntity*>(created)); 360 printf("Created a %s: %s\n", created->getClassName(), created->getName()); 361 } 360 if(created->isA(CL_WORLD_ENTITY)) 361 this->spawn(dynamic_cast<WorldEntity*>(created)); 362 printf("Created a %s: %s\n", created->getClassName(), created->getName()); 363 } 362 364 363 365 // if we load a 'Player' we use it as localPlayer … … 365 367 366 368 //todo do this more elegant 367 if( element->Value() != NULL && !strcmp( element->Value(), "SkyBox")) 368 sky = dynamic_cast<SkyBox*>(created); 369 if( element->Value() != NULL && !strcmp( element->Value(), "Terrain")) 370 { 371 terrain = dynamic_cast<Terrain*>(created); 372 CDEngine::getInstance()->setTerrain(terrain); 373 } 374 element = element->NextSiblingElement(); 375 glmis->step(); //! @todo temporary 369 if( element->Value() != NULL && !strcmp( element->Value(), "SkyBox")) 370 sky = dynamic_cast<SkyBox*>(created); 371 if( element->Value() != NULL && !strcmp( element->Value(), "Terrain")) 372 { 373 terrain = dynamic_cast<Terrain*>(created); 374 CDEngine::getInstance()->setTerrain(terrain); 376 375 } 376 element = element->NextSiblingElement(); 377 glmis->step(); //! @todo temporary 378 } 377 379 PRINTF(4)("Done loading NetworkWorldEntities\n"); 378 380 } 381 } 379 382 380 383 //////////////////////////////
Note: See TracChangeset
for help on using the changeset viewer.