Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 8854 in orxonox.OLD for branches/multi_player_map/src


Ignore:
Timestamp:
Jun 28, 2006, 2:42:19 PM (18 years ago)
Author:
patrick
Message:

multiplayer: kill and hit event extended for event tracing

Location:
branches/multi_player_map/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/multi_player_map/src/lib/collision_reaction/cr_object_damage.cc

    r8838 r8854  
    6363  if( collision->isEntityACollide()) {
    6464    damage = collision->getEntityB()->getDamage();
    65     collision->getEntityA()->hit(damage);
     65    collision->getEntityA()->hit(damage, , collision->getEntityB());
    6666  }
    6767  PRINTF(4)("Dealing damage - %f damage to %s \n", damage, collision->getEntityA()->getClassName());
     
    6969  if( collision->isEntityBCollide()) {
    7070    damage = collision->getEntityA()->getDamage();
    71     collision->getEntityB()->hit(damage);
     71    collision->getEntityB()->hit(damage, collision->getEntityA());
    7272  }
    7373  PRINTF(4)("Dealing damage - %f damage to %s \n", damage, collision->getEntityB()->getClassName());
  • branches/multi_player_map/src/world_entities/world_entity.cc

    r8845 r8854  
    735735 *  @param damage damage to be dealt
    736736 */
    737 void WorldEntity::hit(float damage)
     737void WorldEntity::hit(float damage, WorldEntity* killer)
    738738{
    739739  this->decreaseHealth(damage);
     
    750750
    751751    if( State::getGameRules() != NULL)
    752       State::getGameRules()->registerKill(Kill(NULL, this));
     752      State::getGameRules()->registerKill(Kill(killer, this));
    753753  }
    754754}
  • branches/multi_player_map/src/world_entities/world_entity.h

    r8832 r8854  
    9494  CollisionHandle* getCollisionHandle(CREngine::CRType type) const { return this->collisionHandles[type]; }
    9595
    96   virtual void hit(float damage);
     96  virtual void hit(float damage, WorldEntity* killer);
    9797  virtual void destroy();
    9898
     
    184184  std::string             modelFileName;                   //!< model's file name
    185185  int                     modelFileName_handle;            //!< handle for syncing var
    186  
    187   int                     list_write;                      //!< entity's list 
     186
     187  int                     list_write;                      //!< entity's list
    188188  int                     list_handle;                     //!< handle for list changes
    189189
Note: See TracChangeset for help on using the changeset viewer.