Changeset 9705 in orxonox.OLD for branches/new_class_id/src/world_entities/player.cc
- Timestamp:
- Aug 25, 2006, 9:44:53 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/new_class_id/src/world_entities/player.cc
r9062 r9705 19 19 #include "event_handler.h" 20 20 21 22 #include "class_list.h"23 21 #include "state.h" 24 22 #include "util/hud.h" … … 26 24 #include "debug.h" 27 25 28 26 NewObjectListDefinition(Player); 29 27 /** 30 28 * creates a new Player … … 33 31 { 34 32 // this->setRelDir(Quaternion(M_PI, Vector(1,0,0))); 35 this-> setClassID(CL_PLAYER, "Player");33 this->registerObject(this, Player::_objectList); 36 34 37 35 PRINTF(4)("PLAYER INIT\n"); … … 94 92 95 93 96 97 98 99 94 void Player::weaponConfigChanged() 95 { 96 this->_hud.updateWeaponManager(); 97 } 100 98 101 99 … … 103 101 { 104 102 /// FIXME this should be in the ObjectManager 105 const std::list<BaseObject*>* objectList = ClassList::getList(CL_PLAYABLE); 106 if (objectList != NULL) 103 for (NewObjectList<Playable>::const_iterator node = Playable::objectList().begin(); 104 node != Playable::objectList().end(); 105 ++node) 107 106 { 108 std::list<BaseObject*>::const_iterator node; 109 for (node = objectList->begin(); node != objectList->end(); node++) 110 if (this->playable != (*node) && 111 (dynamic_cast<PNode*>(*node)->getAbsCoor() - this->playable->getAbsCoor()).len() < (dynamic_cast<Playable*>(*node)->getEnterRadius())) 112 { 107 if (this->playable != (*node) && 108 ((*node)->getAbsCoor() - this->playable->getAbsCoor()).len() < ((*node)->getEnterRadius())) 109 { 113 110 114 this->setPlayable(dynamic_cast<Playable*>(*node));111 this->setPlayable(*(node)); 115 112 116 117 113 break; 114 } 118 115 } 119 116 }
Note: See TracChangeset
for help on using the changeset viewer.