Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 9162 in orxonox.OLD for branches


Ignore:
Timestamp:
Jul 4, 2006, 6:15:10 PM (18 years ago)
Author:
rennerc
Message:
 
Location:
branches/presentation/src
Files:
28 edited

Legend:

Unmodified
Added
Removed
  • branches/presentation/src/lib/coord/p_node.cc

    r8316 r9162  
    10891089void PNode::varChangeHandler( std::list< int > & id )
    10901090{
     1091  Synchronizeable::varChangeHandler( id );
     1092 
    10911093  if ( std::find( id.begin(), id.end(), relCoordinate_handle ) != id.end() )
    10921094  {
  • branches/presentation/src/util/multiplayer_team_deathmatch.cc

    r9141 r9162  
    210210  while ( this->killList.begin() != this->killList.end() )
    211211  {
     212    PRINTF(0)("KKKKKKKKIIIIIIIIILLLLLLLLLLLLL\n");
    212213    onKill( this->killList.begin()->getVictim(), this->killList.begin()->getKiller() );
    213214    this->killList.erase( this->killList.begin() );
     
    709710{
    710711  if ( !victim )
    711     return;
     712  {
     713    PRINTF(0)("victim == NULL\n");
     714    return;
     715  }
    712716  if ( !killer )
    713     return;
     717  {
     718    PRINTF(0)("killer == NULL\n");
     719    return;
     720  }
    714721 
    715722  int killerUserId = killer->getOwner();
    716723  int victimUserId = victim->getOwner();
     724 
     725  PRINTF(0)("%d %d %x %x %s %s\n", killerUserId, victimUserId, killer, victim, killer->getClassName(), victim->getClassName());
    717726
    718727  PlayerStats & victimStats = *PlayerStats::getStats( victimUserId );
     
    720729 
    721730  if ( killerStats.getPlayable() != killer || victimStats.getPlayable() != victim )
    722     return;
     731  {
     732    PRINTF(0)("killerStats.getPlayable() != killer || victimStats.getPlayable() != victim\n");
     733    PRINTF(0)("%x %x %x %x\n", killerStats.getPlayable(), killer, victimStats.getPlayable(), victim );
     734    PRINTF(0)("%d %d %d %d\n", killerStats.getPlayable()->getUniqueID(), killer->getUniqueID(), victimStats.getPlayable()->getUniqueID(), victim->getUniqueID() );
     735    return;
     736  }
    723737
    724738  //check for suicide
  • branches/presentation/src/world_entities/creatures/fps_player.cc

    r9160 r9162  
    416416}
    417417
     418void FPSPlayer::destroy( WorldEntity* killer )
     419{
     420  Playable::destroy( killer );
     421 
     422  toList( OM_DEAD );
     423}
     424
  • branches/presentation/src/world_entities/creatures/fps_player.h

    r9150 r9162  
    2727    virtual void reset();
    2828   
     29    virtual void destroy(WorldEntity* killer);
    2930    virtual void respawn();
    3031
  • branches/presentation/src/world_entities/npcs/generic_npc.cc

    r9145 r9162  
    581581
    582582
    583 void GenericNPC::destroy()
     583void GenericNPC::destroy(WorldEntity* killer)
    584584{
    585585  int randi = (int)(5.0f * (float)rand()/(float)RAND_MAX);
  • branches/presentation/src/world_entities/npcs/generic_npc.h

    r9061 r9162  
    7777
    7878
    79   void destroy();
     79  virtual void destroy(WorldEntity* killer);
    8080
    8181  private:
  • branches/presentation/src/world_entities/npcs/ground_turret.cc

    r8777 r9162  
    176176}
    177177
    178 void GroundTurret::destroy()
     178void GroundTurret::destroy(WorldEntity* killer)
    179179{
    180180  this->setAbsDirSoft(Quaternion(-90, Vector(0,0,1)), 90);
  • branches/presentation/src/world_entities/npcs/ground_turret.h

    r7954 r9162  
    2525  virtual void leftWorld ();
    2626
    27   virtual void destroy();
     27  virtual void destroy(WorldEntity* killer);
    2828
    2929  virtual void draw() const;
  • branches/presentation/src/world_entities/playable.cc

    r9138 r9162  
    401401
    402402
    403 void Playable::destroy()
    404 {
    405   Explosion::explode(dynamic_cast<PNode*>(this), Vector(1.0f, 1.0f, 1.0f));
    406 
    407 
     403void Playable::destroy(WorldEntity* killer)
     404{
    408405  if( !this->bDead)
    409406  {
     
    414411      if( this == State::getPlayer()->getPlayable())
    415412        State::getGameRules()->onPlayerDeath();
    416 
    417       //     this->toList(OM_GROUP_05);
    418       //HACK: moves the entity to an unknown place far far away: in the future, GameRules will look for that
    419       this->setAbsCoor(-2000.0, -2000.0, -2000.0);
    420 
    421       //explosion hack
    422 
    423413    }
    424414    this->bDead = true;
     415   
     416    if( State::getGameRules() != NULL)
     417      State::getGameRules()->registerKill(Kill(killer, this));
    425418  }
    426419}
  • branches/presentation/src/world_entities/playable.h

    r9061 r9162  
    8080
    8181  // WorldEntity Extensions
    82   virtual void destroy();
     82  virtual void destroy(WorldEntity* killer);
    8383  virtual void respawn();
    8484  virtual void collidesWith(WorldEntity* entity, const Vector& location);
  • branches/presentation/src/world_entities/projectiles/guided_missile.cc

    r8362 r9162  
    135135{
    136136  if (this->hitEntity != entity)
    137     this->destroy();
     137    this->destroy( entity );
    138138  this->hitEntity = entity;
    139139}
     
    180180 *  the function gets called, when the projectile is destroyed
    181181 */
    182 void GuidedMissile::destroy ()
    183 {
    184   Projectile::destroy();
     182void GuidedMissile::destroy (WorldEntity* killer)
     183{
     184  Projectile::destroy( killer );
    185185  PRINTF(5)("DESTROY GuidedMissile\n");
    186186  this->lifeCycle = .95; //!< @todo calculate this usefully.
  • branches/presentation/src/world_entities/projectiles/guided_missile.h

    r6622 r9162  
    2626    virtual void collidesWith(WorldEntity* entity, const Vector& location);
    2727
    28     virtual void destroy ();
     28    virtual void destroy (WorldEntity* killer);
    2929
    3030    virtual void tick (float time);
  • branches/presentation/src/world_entities/projectiles/hyperblast.cc

    r8362 r9162  
    126126 *  the function gets called, when the projectile is destroyed
    127127*/
    128 void Hyperblast::destroy ()
     128void Hyperblast::destroy (WorldEntity* killer)
    129129{
    130   Projectile::destroy();
     130  Projectile::destroy( killer );
    131131
    132132  PRINTF(5)("DESTROY Hyperblast\n");
  • branches/presentation/src/world_entities/projectiles/hyperblast.h

    r6821 r9162  
    2727    virtual void collidesWith(WorldEntity* entity, const Vector& location);
    2828
    29     virtual void destroy ();
     29    virtual void destroy (WorldEntity* killer);
    3030
    3131    virtual void tick (float time);
  • branches/presentation/src/world_entities/projectiles/laser.cc

    r9061 r9162  
    107107{
    108108  if (this->hitEntity != entity && entity->isA(CL_NPC))
    109     this->destroy();
     109    this->destroy( entity );
    110110  this->hitEntity = entity;
    111111}
     
    128128 *  the function gets called, when the projectile is destroyed
    129129*/
    130 void Laser::destroy ()
     130void Laser::destroy (WorldEntity* killer)
    131131{
    132   Projectile::destroy();
     132  Projectile::destroy( killer );
    133133  PRINTF(5)("DESTROY Laser\n");
    134134  this->lifeCycle = .95; //!< @todo calculate this usefully.
  • branches/presentation/src/world_entities/projectiles/laser.h

    r6622 r9162  
    2727    virtual void collidesWith(WorldEntity* entity, const Vector& location);
    2828
    29     virtual void destroy ();
     29    virtual void destroy (WorldEntity* killer);
    3030
    3131    virtual void tick (float dt);
  • branches/presentation/src/world_entities/projectiles/projectile.cc

    r8362 r9162  
    162162
    163163  if (this->tickLifeCycle(dt))
    164     this->destroy();
     164    this->destroy( NULL );
    165165}
    166166
     
    169169 *  the function gets called, when the projectile is destroyed
    170170*/
    171 void Projectile::destroy ()
     171void Projectile::destroy (WorldEntity* killer)
    172172{
    173173  if (this->explosionBuffer != NULL)
  • branches/presentation/src/world_entities/projectiles/projectile.h

    r7460 r9162  
    4141    virtual void deactivate() = 0;
    4242
    43     virtual void destroy ();
     43    virtual void destroy (WorldEntity* killer);
    4444
    4545    virtual void tick (float dt);
  • branches/presentation/src/world_entities/projectiles/rocket.cc

    r8362 r9162  
    128128{
    129129  if (this->hitEntity != entity)
    130     this->destroy();
     130    this->destroy( entity );
    131131  this->hitEntity = entity;
    132132}
     
    149149 *  the function gets called, when the projectile is destroyed
    150150*/
    151 void Rocket::destroy ()
     151void Rocket::destroy (WorldEntity* killer)
    152152{
    153   Projectile::destroy();
     153  Projectile::destroy( killer );
    154154
    155155  PRINTF(5)("DESTROY Rocket\n");
  • branches/presentation/src/world_entities/projectiles/rocket.h

    r6622 r9162  
    2727    virtual void collidesWith(WorldEntity* entity, const Vector& location);
    2828
    29     virtual void destroy ();
     29    virtual void destroy (WorldEntity* killer);
    3030
    3131    virtual void tick (float time);
  • branches/presentation/src/world_entities/projectiles/test_bullet.cc

    r8362 r9162  
    119119{
    120120  if (this->hitEntity != entity && entity->isA(CL_NPC))
    121     this->destroy();
     121    this->destroy( entity );
    122122  this->hitEntity = entity;
    123123}
     
    147147 *  the function gets called, when the projectile is destroyed
    148148*/
    149 void TestBullet::destroy ()
     149void TestBullet::destroy (WorldEntity* killer)
    150150{
    151151  PRINTF(5)("DESTROY TestBullet\n");
  • branches/presentation/src/world_entities/projectiles/test_bullet.h

    r6624 r9162  
    2727    virtual void collidesWith(WorldEntity* entity, const Vector& location);
    2828
    29     virtual void destroy ();
     29    virtual void destroy (WorldEntity* killer);
    3030
    3131    virtual void tick (float time);
  • branches/presentation/src/world_entities/space_ships/space_ship.cc

    r9110 r9162  
    513513}
    514514
    515 void SpaceShip::destroy( )
     515void SpaceShip::destroy( WorldEntity* killer )
    516516{
    517517  PRINTF(0)("spaceship destroy\n");
  • branches/presentation/src/world_entities/space_ships/space_ship.h

    r9008 r9162  
    3737    virtual void leftWorld();
    3838   
    39     virtual void destroy();
     39    virtual void destroy(WorldEntity* killer);
    4040    virtual void respawn();
    4141
  • branches/presentation/src/world_entities/test_entity.cc

    r9003 r9162  
    116116  if( this->lastCollided != entity)
    117117  {
    118     this->destroy();
     118    this->destroy( entity );
    119119    this->lastCollided = entity;
    120120
     
    126126
    127127
    128 void TestEntity::destroy()
     128void TestEntity::destroy(WorldEntity* killer)
    129129{
    130130  if( this->bDeath)
  • branches/presentation/src/world_entities/test_entity.h

    r8778 r9162  
    2525  void setAnim(int animationIndex, int animPlaybackMode);
    2626
    27   virtual void destroy();
     27  virtual void destroy(WorldEntity* killer);
    2828
    2929  virtual void tick (float time);
  • branches/presentation/src/world_entities/world_entity.cc

    r9122 r9162  
    750750  else
    751751  {
    752     this->destroy();
    753 
    754     if( State::getGameRules() != NULL)
    755       State::getGameRules()->registerKill(Kill(killer, this));
     752    this->destroy( killer );
    756753  }
    757754}
     
    761758 * destoys the world entity
    762759 */
    763 void WorldEntity::destroy()
     760void WorldEntity::destroy(WorldEntity* killer)
    764761{
    765762  this->toList(OM_DEAD);
  • branches/presentation/src/world_entities/world_entity.h

    r9110 r9162  
    101101  virtual void hit(float damage, WorldEntity* killer);
    102102
    103   virtual void destroy();
     103  virtual void destroy( WorldEntity* killer );
    104104
    105105
Note: See TracChangeset for help on using the changeset viewer.