Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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


Ignore:
Timestamp:
Jun 26, 2006, 12:59:13 AM (18 years ago)
Author:
patrick
Message:

trunk: damage and distruction reimplemented

File:
1 edited

Legend:

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

    r8724 r8777  
    3838#include "collision_handle.h"
    3939#include "collision_event.h"
     40#include "game_rules.h"
     41#include "kill.h"
    4042
    4143#include <stdarg.h>
     
    8284
    8385  // registering default reactions:
    84 //   this->subscribeReaction(CREngine::CR_OBJECT_DAMAGE, CL_WORLD_ENTITY);
     86  this->subscribeReaction(CREngine::CR_OBJECT_DAMAGE, CL_WORLD_ENTITY);
    8587
    8688  this->toList(OM_NULL);
     
    736738  this->decreaseHealth(damage);
    737739
     740  PRINTF(0)("Hit me: %s now only %f/%f health\n", this->getClassName(), this->getHealth(), this->getHealthMax());
     741
    738742  if( this->getHealth() > 0)
    739743  {
     
    744748    this->destroy();
    745749
    746 //     if( State::getGameRules() != NULL)
    747 //       State::getGameRules()->registerKill(Kill(NULL, this));
    748   }
     750    if( State::getGameRules() != NULL)
     751      State::getGameRules()->registerKill(Kill(NULL, this));
     752  }
     753}
     754
     755
     756/**
     757 * destoys the world entity
     758 */
     759void WorldEntity::destroy()
     760{
     761  PRINTF(0)("Destroy\n");
     762  this->toList(OM_DEAD);
    749763}
    750764
Note: See TracChangeset for help on using the changeset viewer.