Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 8856 in orxonox.OLD


Ignore:
Timestamp:
Jun 28, 2006, 2:43:05 PM (18 years ago)
Author:
rennerc
Message:

fixed segfault

Location:
branches/multi_player_map/src/util
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/multi_player_map/src/util/game_rules.cc

    r8840 r8856  
    9292
    9393  PRINTF(0)("Received Event: Kill\n");
    94 //   this->killList.push_back(kill);
     94
     95  this->killList.push_back( kill );
    9596}
    9697
  • branches/multi_player_map/src/util/game_rules.h

    r8802 r8856  
    99
    1010#include "base_object.h"
     11#include <list>
    1112#include <vector>
    1213
     
    5455    std::vector<MissionGoal*>   missionList;            //!< list of mission goals
    5556
    56     std::vector<Kill>          killList;               //!<  list of kills in the world
     57    std::list<Kill>             killList;               //!<  list of kills in the world
    5758};
    5859
  • branches/multi_player_map/src/util/multiplayer_team_deathmatch.cc

    r8851 r8856  
    6868  this->numTeams = 2;
    6969  this->currentGameState = GAMESTATE_PRE_GAME;
    70   this->gameStateTimer = 10.0f;
     70  this->gameStateTimer = 3.0f;
    7171  this->bShowTeamChange = false;
    7272
     
    221221
    222222  //handle kills
    223   for ( std::vector<Kill>::iterator it = this->killList.begin(); it != this->killList.end();  )
    224   {
    225     std::vector<Kill>::iterator delit = it;
    226 
    227     onKill( it->getKiller()->getOwner(), it->getVictim()->getOwner() );
    228 
    229     it++;
    230     killList.erase( delit );
    231   }
     223  while ( this->killList.begin() != this->killList.end() )
     224  {
     225    if ( this->killList.begin()->getKiller() != NULL && this->killList.begin()->getVictim() != NULL )
     226      onKill( this->killList.begin()->getKiller()->getOwner(), this->killList.begin()->getVictim()->getOwner() );
     227    this->killList.erase( this->killList.begin() );
     228  }
     229 
     230
    232231
    233232  gameStateTimer -= dt;
Note: See TracChangeset for help on using the changeset viewer.