Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jul 27, 2006, 1:59:30 PM (18 years ago)
Author:
patrick
Message:

the player team change should now work on all clients in the network, its now a global synch variable

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/proxy/src/world_entities/playable.cc

    r9500 r9507  
    6868
    6969
     70  this->teamChangeHandler = registerVarId( new SynchronizeableInt( &this->teamId, &this->teamId, "team-id" ) );
    7071  registerVar( new SynchronizeableInt( &score, &score, "score" ) );
    7172  registerVar( new SynchronizeableBool( &bFire, &bFire, "bFire", PERMISSION_OWNER));
     
    524525  "FirstPerson"
    525526};
     527
     528
     529/**
     530 * handler for changes on registred vars
     531 * @param id id's which changed
     532 */
     533void Playable::varChangeHandler( std::list< int > & id )
     534{
     535  if ( std::find( id.begin(), id.end(), this->teamChangeHandler) != id.end() )
     536  {
     537    this->setTeam(this->teamId);
     538  }
     539
     540  WorldEntity::varChangeHandler(id);
     541}
Note: See TracChangeset for help on using the changeset viewer.