Changeset 6251 in orxonox.OLD for branches/network/src/story_entities
- Timestamp:
- Dec 21, 2005, 4:40:13 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/network/src/story_entities/network_world.cc
r6250 r6251 352 352 while( element != NULL) 353 353 { 354 if( NetworkManager::getInstance()->isGameServer() || !strcmp( element->Value(), "SkyBox") || !strcmp( element->Value(), "Terrain") 355 || !strcmp( element->Value(), "SpaceShip")) 354 if( NetworkManager::getInstance()->isGameServer()) 356 355 { 357 356 … … 378 377 } 379 378 379 } 380 else if( !strcmp( element->Value(), "SkyBox") /*|| !strcmp( element->Value(), "Terrain")*/ || !strcmp( element->Value(), "SpaceShip")) 381 { 382 BaseObject* created = Factory::fabricate(element); 383 if( created != NULL ) 384 { 385 if(created->isA(CL_WORLD_ENTITY)) 386 this->spawn(dynamic_cast<WorldEntity*>(created)); 387 printf("Created a %s: %s\n", created->getClassName(), created->getName()); 388 } 389 else 390 PRINTF(1)("NetworkWorld: could not create this entity\n"); 391 392 // if we load a 'Player' we use it as localPlayer 393 394 395 //todo do this more elegant 396 if( element->Value() != NULL && !strcmp( element->Value(), "SkyBox")) 397 sky = dynamic_cast<SkyBox*>(created); 398 if( element->Value() != NULL && !strcmp( element->Value(), "Terrain")) 399 { 400 terrain = dynamic_cast<Terrain*>(created); 401 CDEngine::getInstance()->setTerrain(terrain); 402 } 380 403 } 381 404 element = element->NextSiblingElement();
Note: See TracChangeset
for help on using the changeset viewer.