Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 18, 2008, 10:00:17 PM (16 years ago)
Author:
scheusso
Message:

made clientinformation threadsafe and improved packetbuffer; wrote a static function SpaceShip *SpaceShip::getLocalShip. it returns the pointer to the ship that should be steered

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/merge/src/orxonox/objects/SpaceShip.cc

    r1306 r1318  
    6464    SpaceShip* SpaceShip::instance_s;
    6565
     66    SpaceShip *SpaceShip::getLocalShip(){
     67      Iterator<SpaceShip> it;
     68      for(it = ObjectList<SpaceShip>::start(); it; ++it){
     69        if((it)->server_ || ( network::Client::getSingleton() && network::Client::getSingleton()->getShipID()==it->objectID ) )
     70          return *it;
     71      }
     72      return NULL;
     73    }
     74   
    6675    SpaceShip::SpaceShip() :
    6776      //testvector_(0,0,0),
Note: See TracChangeset for help on using the changeset viewer.