I added this code into gAIPlayer::Timestep in src/tron/gAIBase.cpp
currently it doesnt do anything except read x y xdir and ydir but it just seems to lockup the server.
does anyone know what im doing wrong ?. thanks
Code: Select all
3285 // get list of game objects
3286 const tList<eGameObject>& gameObjects = Object()->Grid()->GameObjects();
3287
3288 // search object list
3289 for (int i=gameObjects.Len()-1; i>=0; i--)
3290 {
3291 // get target cycle
3292 gCycle *target=dynamic_cast<gCycle *>(gameObjects(i));
3293
3294 // get target coordinates and direction
3295 REAL tarX = target->Position().x;
3296 REAL tarY = target->Position().y;
3297 REAL tarDirX = target->Direction().x;
3298 REAL tarDirY = target->Direction().y;
3299
3300 // if(st_aiDebug)
3301 // {
3302 // lbm="";
3303 // lbm << "tarX = " << tarX << ", tarY = " << tarY << ", tarDirX = " << tarDirX << ", tarDirY = " << tarDirY << "\n";
3304 // sn_ConsoleOut(lbm);
3305 // }
3306
3307 }