Changeset 10708 in orxonox.OLD for branches/presentation/src/world_entities/world_entity.cc
- Timestamp:
- Jun 16, 2007, 11:15:39 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/presentation/src/world_entities/world_entity.cc
r10704 r10708 97 97 this->entityTrack = NULL; 98 98 this->bDrawTrack = false; 99 100 this->forwardDamageToParent = false; 99 101 100 102 // registering default reactions: … … 179 181 LoadParam(root, "drawTrack", this, WorldEntity, drawDebugTrack) 180 182 .describe("draws the track for debugging purposes"); 183 184 LoadParam(root, "forwardDamageToParent", this, WorldEntity, setForwardDamageToParent); 181 185 182 186 // Track … … 980 984 void WorldEntity::hit(float damage, WorldEntity* killer) 981 985 { 982 986 PRINTF(0)("TESTS: %i %i %i\n", (forwardDamageToParent), (this->getParent() != NullParent::getNullParent()), (this->getParent()->isA( WorldEntity::staticClassID() ))); 987 if ( forwardDamageToParent && this->getParent() != NullParent::getNullParent() && this->getParent()->isA( WorldEntity::staticClassID() ) ) 988 { 989 WorldEntity* pa = dynamic_cast<WorldEntity*>(this->getParent()); 990 pa->hit( damage, killer ); 991 return; 992 } 993 994 bool dead = this->getHealth()<=0; 995 983 996 this->decreaseHealth(damage); 984 997 … … 991 1004 else 992 1005 { 993 this->destroy( killer ); 1006 if ( !dead ) 1007 this->destroy( killer ); 994 1008 } 995 1009 }
Note: See TracChangeset
for help on using the changeset viewer.