Changeset 2662 for code/trunk/src/orxonox/objects/infos/PlayerInfo.cc
- Timestamp:
- Feb 14, 2009, 10:17:35 PM (15 years ago)
- Location:
- code/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk
- Property svn:mergeinfo changed
-
code/trunk/src/orxonox/objects/infos/PlayerInfo.cc
r2171 r2662 46 46 this->bLocalPlayer_ = false; 47 47 this->bReadyToSpawn_ = false; 48 this->bSetUnreadyAfterSpawn_ = true; 48 49 this->controller_ = 0; 49 50 this->controllableEntity_ = 0; … … 64 65 this->controller_ = 0; 65 66 } 67 68 if (this->getGametype()) 69 this->getGametype()->playerLeft(this); 66 70 } 67 71 } … … 69 73 void PlayerInfo::registerVariables() 70 74 { 71 REGISTERSTRING(this->name_, direction::toclient, new NetworkCallback<PlayerInfo>(this, &PlayerInfo::changedName));72 REGISTERDATA (this->controllableEntityID_, direction::toclient, new NetworkCallback<PlayerInfo>(this, &PlayerInfo::networkcallback_changedcontrollableentityID));73 REGISTERDATA (this->bReadyToSpawn_, direction::toserver);75 registerVariable(this->name_, variableDirection::toclient, new NetworkCallback<PlayerInfo>(this, &PlayerInfo::changedName)); 76 registerVariable(this->controllableEntityID_, variableDirection::toclient, new NetworkCallback<PlayerInfo>(this, &PlayerInfo::networkcallback_changedcontrollableentityID)); 77 registerVariable(this->bReadyToSpawn_, variableDirection::toserver); 74 78 } 75 79 76 80 void PlayerInfo::changedName() 77 81 { 82 SUPER(PlayerInfo, changedName); 83 78 84 if (this->isInitialized() && this->getGametype()) 79 85 this->getGametype()->playerChangedName(this); … … 109 115 if (this->controllableEntity_) 110 116 this->controller_->setControllableEntity(this->controllableEntity_); 117 this->changedController(); 111 118 } 112 119 113 void PlayerInfo::startControl(ControllableEntity* entity )120 void PlayerInfo::startControl(ControllableEntity* entity, bool callback) 114 121 { 122 if (entity == this->controllableEntity_) 123 return; 124 115 125 if (this->controllableEntity_) 116 this->stopControl(this->controllableEntity_ );126 this->stopControl(this->controllableEntity_, callback); 117 127 118 128 this->controllableEntity_ = entity; … … 122 132 this->controllableEntityID_ = entity->getObjectID(); 123 133 entity->setPlayer(this); 124 this->bReadyToSpawn_ = false;134 this->bReadyToSpawn_ &= (!this->bSetUnreadyAfterSpawn_); 125 135 } 126 136 else
Note: See TracChangeset
for help on using the changeset viewer.