Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 10513 in orxonox.OLD for trunk


Ignore:
Timestamp:
Jan 30, 2007, 8:12:15 PM (18 years ago)
Author:
patrick
Message:

ai segfault fixed

Location:
trunk/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/ai/ai_engine.h

    r10376 r10513  
    77
    88
    9 class AIEngine{
    10  public:
    11         ~AIEngine(){}
     9class AIEngine
     10{
     11public:
     12  ~AIEngine() { singletonRef = NULL; }
    1213
    13    static AIEngine* getInstance() { if( singletonRef == NULL) singletonRef = new AIEngine(); return singletonRef; }
     14  static AIEngine* getInstance() { if( singletonRef == NULL) singletonRef = new AIEngine(); return singletonRef; }
    1415
    15    void tick(float dt);
    16         void addAI(int teamNumber, int swarmNumber, WorldEntity* npc, float maxSpeed, float attackDistance);
    17         void removeAI(int teamNumber, int swarmNumber, WorldEntity* npc);
     16  void tick(float dt);
     17  void addAI(int teamNumber, int swarmNumber, WorldEntity* npc, float maxSpeed, float attackDistance);
     18  void removeAI(int teamNumber, int swarmNumber, WorldEntity* npc);
    1819
    19  private:
    20         AIEngine(){}
    21         static AIEngine* singletonRef;
    22         std::map<int,AITeam*> teams;
     20private:
     21  AIEngine()
     22{}
     23  static AIEngine* singletonRef;
     24  std::map<int,AITeam*> teams;
    2325};
    2426
  • trunk/src/story_entities/game_world_data.cc

    r10428 r10513  
    5252#include "network_manager.h"
    5353#include "physics_engine.h"
     54#include "ai_engine.h"
    5455
    5556#include "glmenu_imagescreen.h"
     
    105106  //State::setCameraman(camMan);
    106107  LightManager::getInstance();
     108  AIEngine::getInstance();
    107109
    108110//  GraphicsEngine::getInstance()->displayFPS(true);
     
    130132    this->setName(string.c_str());
    131133
     134
    132135  this->loadGUI(root);
    133136  this->loadWorldEntities(root);
     
    148151  this->unloadScene();
    149152  this->unloadCameras();
     153
     154  // killl ai engine
     155  delete AIEngine::getInstance();
    150156
    151157  return ErrorMessage();
  • trunk/src/world_entities/mount_point.cc

    r10491 r10513  
    168168    if( obj->isA( WorldEntity::staticClassID()))
    169169    {
     170      PRINTF(0)("Mount Point created a %s\n", obj->getCName());
    170171      // cast down the object to WE
    171172      this->_mount = dynamic_cast<WorldEntity*>(obj);
Note: See TracChangeset for help on using the changeset viewer.