Changeset 7072 in orxonox.OLD for trunk/src/world_entities/playable.cc
- Timestamp:
- Feb 7, 2006, 3:06:34 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/world_entities/playable.cc
r7044 r7072 125 125 void Playable::collidesWith(WorldEntity* entity, const Vector& location) 126 126 { 127 if (entity->isA(CL_PROJECTILE) && !State::isOnline() ) 128 { 129 this->decreaseHealth(entity->getHealth()); 127 if (entity == collider) 128 return; 129 collider = entity; 130 131 if (entity->isA(CL_PROJECTILE)) 132 { 133 this->decreaseHealth(entity->getHealth() *(float)rand()/(float)RAND_MAX); 130 134 // EXTREME HACK 131 if (this->getHealth() == 0.0f)135 if (this->getHealth() <= 0.0f) 132 136 { 133 137 this->die(); … … 157 161 PRINTF(0)("Playable dies\n"); 158 162 // only if this is the spaceship of the player 163 if (State::isOnline()) 164 { 159 165 if( this == State::getPlayer()->getPlayable()) 160 166 State::getGameRules()->onPlayerDeath(); … … 168 174 this->setAbsCoor(0, 0, 0); 169 175 this->emitter->setSystem(NULL); 176 } 170 177 } 171 178
Note: See TracChangeset
for help on using the changeset viewer.