Changeset 9235 in orxonox.OLD for trunk/src/world_entities/world_entity.cc
- Timestamp:
- Jul 5, 2006, 4:39:02 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/world_entities/world_entity.cc
r9110 r9235 85 85 86 86 this->toList(OM_NULL); 87 87 88 88 registerVar( new SynchronizeableString( &this->md2TextureFileName, &this->md2TextureFileName, "md2TextureFileName" ) ); 89 89 modelFileName_handle = registerVarId( new SynchronizeableString( &modelFileName, &modelFileName, "modelFileName" ) ); 90 90 scaling_handle = registerVarId( new SynchronizeableFloat( &scaling, &scaling, "scaling" ) ); 91 91 list_handle = registerVarId( new SynchronizeableInt( (int*)&objectListNumber, &list_write, "list" ) ); 92 92 93 93 health_handle = registerVarId( new SynchronizeableFloat( &this->health, &this->health_write, "health" ) ); 94 94 healthMax_handle = registerVarId( new SynchronizeableFloat( &this->healthMax, &this->healthMax_write, "maxHealth" ) ); … … 209 209 this->buildObbTree(obbTreeDepth); 210 210 } 211 else /*if(fileName.find(".md3") != std::string::npos)*/211 else if(fileName.find(".md3") != std::string::npos) 212 212 { 213 213 PRINTF(4)("fetching MD3 file: %s\n", fileName.c_str()); … … 414 414 bool WorldEntity::registerCollision(WorldEntity* entityA, WorldEntity* entityB, BoundingVolume* bvA, BoundingVolume* bvB) 415 415 { 416 PRINTF(5)("registering collision of type: %s vs %s\n", entityA->getClassName(), entityB->getClassName()); 416 417 // is there any handler listening? 417 418 if( !this->bReactive) … … 571 572 */ 572 573 void WorldEntity::reset() 573 {} 574 { 575 this->setHealth( this->getHealthMax() ); 576 } 574 577 575 578 /** … … 742 745 this->decreaseHealth(damage); 743 746 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()); 745 748 746 749 if( this->getHealth() > 0) … … 750 753 else 751 754 { 752 this->destroy(); 753 754 if( State::getGameRules() != NULL) 755 State::getGameRules()->registerKill(Kill(killer, this)); 755 this->destroy( killer ); 756 756 } 757 757 } … … 761 761 * destoys the world entity 762 762 */ 763 void WorldEntity::destroy( )763 void WorldEntity::destroy(WorldEntity* killer) 764 764 { 765 765 this->toList(OM_DEAD); … … 841 841 this->toList( (OM_LIST)list_write ); 842 842 } 843 843 844 844 if ( std::find( id.begin(), id.end(), health_handle ) != id.end() ) 845 845 { 846 846 this->setHealth( health_write ); 847 847 } 848 848 849 849 if ( std::find( id.begin(), id.end(), healthMax_handle ) != id.end() ) 850 850 {
Note: See TracChangeset
for help on using the changeset viewer.