Changeset 9656 in orxonox.OLD for trunk/src/world_entities/playable.cc
- Timestamp:
- Aug 4, 2006, 11:01:28 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/world_entities/playable.cc
r9406 r9656 68 68 69 69 70 registerVar( new SynchronizeableInt( &score, &score, "score" ) ); 70 this->teamChangeHandler = registerVarId( new SynchronizeableInt( &this->teamId, &this->teamId, "team-id", PERMISSION_MASTER_SERVER ) ); 71 72 registerVar( new SynchronizeableInt( &score, &score, "score", PERMISSION_MASTER_SERVER ) ); 71 73 registerVar( new SynchronizeableBool( &bFire, &bFire, "bFire", PERMISSION_OWNER)); 72 74 } … … 139 141 bool Playable::addWeapon(Weapon* weapon, int configID, int slotID) 140 142 { 143 weapon->setOwner(this->getOwner()); 144 145 141 146 if(this->weaponMan.addWeapon(weapon, configID, slotID)) 142 147 { … … 272 277 return false; 273 278 } 279 280 281 /** 282 * @brief sets the TeamID and all the properties needed to be visible on the Playable 283 * @param teamID: the new TeamID of the Entity 284 */ 285 void Playable::setTeam(int teamID) 286 { 287 /// Derive this function to make it look different with differen groups. 288 PRINTF(4)("No special team specific function implemented for %s::%s in Team %d\n", this->getClassCName(), this->getCName(), teamID); 289 } 290 274 291 275 292 /** … … 512 529 "FirstPerson" 513 530 }; 531 532 533 /** 534 * handler for changes on registred vars 535 * @param id id's which changed 536 */ 537 void Playable::varChangeHandler( std::list< int > & id ) 538 { 539 if ( std::find( id.begin(), id.end(), this->teamChangeHandler) != id.end() ) 540 { 541 this->setTeam(this->teamId); 542 } 543 544 WorldEntity::varChangeHandler(id); 545 }
Note: See TracChangeset
for help on using the changeset viewer.