.:: Bots United ::.

.:: Bots United ::. (http://forums.bots-united.com/index.php)
-   General Bot Coding (http://forums.bots-united.com/forumdisplay.php?f=24)
-   -   Help Needed !!! (http://forums.bots-united.com/showthread.php?t=930)

slash-evil 28-02-2004 00:23

Help Needed !!!
 
In my bot debugging process , I found out that in my ot code , this line is always causing crash

if(paths[pBot->curr_wpt_index]->flags & W_FL_GOAL)

(it is a part of bomb planting !)

I try to fix it , but it still happened , does who know why this happened ? ???:(

botman 28-02-2004 15:23

Re: Help Needed !!!
 
if 'pBot->curr_wpt_index' is too large (bigger than the size of the 'paths' array) that can cause an access violation trying to access memory that the process don't have in it's memory space.

Also, if 'pBot' is NULL, this will cause it to crash.

Put in some code to print the value of 'pBot->curr_wpt_index' to a text file or to the console (or HUD) so you can see what the values are. Also change the code to look more like this...

if (pBot)
{
if (paths[pBot->curr_wpt_index]->flags & W_FL_GOAL)
{
// do stuff here
}
}

botman

slash-evil 28-02-2004 16:11

Re: Help Needed !!!
 
thanks botman currently I am testing the code !


All times are GMT +2. The time now is 16:30.

Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.