Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 9235 in orxonox.OLD for trunk/src/world_entities/world_entity.cc


Ignore:
Timestamp:
Jul 5, 2006, 4:39:02 PM (18 years ago)
Author:
bensch
Message:

merged the presentation back

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/world_entities/world_entity.cc

    r9110 r9235  
    8585
    8686  this->toList(OM_NULL);
    87  
     87
    8888  registerVar( new SynchronizeableString( &this->md2TextureFileName, &this->md2TextureFileName, "md2TextureFileName" ) );
    8989  modelFileName_handle = registerVarId( new SynchronizeableString( &modelFileName, &modelFileName, "modelFileName" ) );
    9090  scaling_handle = registerVarId( new SynchronizeableFloat( &scaling, &scaling, "scaling" ) );
    9191  list_handle = registerVarId( new SynchronizeableInt( (int*)&objectListNumber, &list_write, "list" ) );
    92  
     92
    9393  health_handle = registerVarId( new SynchronizeableFloat( &this->health, &this->health_write, "health" ) );
    9494  healthMax_handle = registerVarId( new SynchronizeableFloat( &this->healthMax, &this->healthMax_write, "maxHealth" ) );
     
    209209        this->buildObbTree(obbTreeDepth);
    210210    }
    211     else /*if(fileName.find(".md3") != std::string::npos)*/
     211    else if(fileName.find(".md3") != std::string::npos)
    212212    {
    213213      PRINTF(4)("fetching MD3 file: %s\n", fileName.c_str());
     
    414414bool WorldEntity::registerCollision(WorldEntity* entityA, WorldEntity* entityB, BoundingVolume* bvA, BoundingVolume* bvB)
    415415{
     416  PRINTF(5)("registering collision of type: %s vs %s\n", entityA->getClassName(), entityB->getClassName());
    416417  // is there any handler listening?
    417418  if( !this->bReactive)
     
    571572 */
    572573void WorldEntity::reset()
    573 {}
     574{
     575  this->setHealth( this->getHealthMax() );
     576}
    574577
    575578/**
     
    742745  this->decreaseHealth(damage);
    743746
    744   PRINTF(0)("Hit me: %s now only %f/%f health\n", this->getClassName(), this->getHealth(), this->getHealthMax());
     747  PRINTF(5)("Hit me: %s now only %f/%f health\n", this->getClassName(), this->getHealth(), this->getHealthMax());
    745748
    746749  if( this->getHealth() > 0)
     
    750753  else
    751754  {
    752     this->destroy();
    753 
    754     if( State::getGameRules() != NULL)
    755       State::getGameRules()->registerKill(Kill(killer, this));
     755    this->destroy( killer );
    756756  }
    757757}
     
    761761 * destoys the world entity
    762762 */
    763 void WorldEntity::destroy()
     763void WorldEntity::destroy(WorldEntity* killer)
    764764{
    765765  this->toList(OM_DEAD);
     
    841841    this->toList( (OM_LIST)list_write );
    842842  }
    843  
     843
    844844  if ( std::find( id.begin(), id.end(), health_handle ) != id.end() )
    845845  {
    846846    this->setHealth( health_write );
    847847  }
    848  
     848
    849849  if ( std::find( id.begin(), id.end(), healthMax_handle ) != id.end() )
    850850  {
Note: See TracChangeset for help on using the changeset viewer.