Changeset 5881 in orxonox.OLD for branches/spaceshipcontrol/src/story_entities
- Timestamp:
- Dec 3, 2005, 1:26:03 AM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/spaceshipcontrol/src/story_entities/world.cc
r5851 r5881 316 316 if( created != NULL) this->spawn( created); 317 317 // if we load a 'Player' we use it as localPlayer 318 318 319 //todo do this more elegant 319 if( element->Value() != NULL && !strcmp( element->Value(), "Player"))320 {321 localPlayer = (Player*) created;322 }323 320 if( element->Value() != NULL && !strcmp( element->Value(), "SkyBox")) sky = (SkyBox*) created; 324 321 if( element->Value() != NULL && !strcmp( element->Value(), "Terrain")) … … 362 359 /* GENERIC LOADING PROCESS FINISHED */ 363 360 361 362 // Create a Player 363 this->localPlayer = new Player(); 364 list<BaseObject*>* playableList = ClassList::getList(CL_PLAYABLE); 365 if (playableList != NULL) 366 { 367 Playable* playable = dynamic_cast<Playable*>(playableList->front()); 368 if (playable != NULL) 369 this->localPlayer->setControllable(playable); 370 } 364 371 // bind input 365 372 EventHandler::getInstance()->subscribe(this->localPlayer, ES_GAME, KeyMapper::PEV_UP);
Note: See TracChangeset
for help on using the changeset viewer.