Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7072 in orxonox.OLD for trunk/src/world_entities/playable.cc


Ignore:
Timestamp:
Feb 7, 2006, 3:06:34 PM (18 years ago)
Author:
bensch
Message:

collision stuff

File:
1 edited

Legend:

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

    r7044 r7072  
    125125void Playable::collidesWith(WorldEntity* entity, const Vector& location)
    126126{
    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);
    130134    // EXTREME HACK
    131     if (this->getHealth() == 0.0f)
     135    if (this->getHealth() <= 0.0f)
    132136    {
    133137      this->die();
     
    157161  PRINTF(0)("Playable dies\n");
    158162  // only if this is the spaceship of the player
     163  if (State::isOnline())
     164  {
    159165  if( this == State::getPlayer()->getPlayable())
    160166    State::getGameRules()->onPlayerDeath();
     
    168174  this->setAbsCoor(0, 0, 0);
    169175  this->emitter->setSystem(NULL);
     176  }
    170177}
    171178
Note: See TracChangeset for help on using the changeset viewer.