.:: Bots United ::.

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

slash-evil 06-03-2004 14:52

See this !!!
 
See this piece of code ... :(

Code:

if(BotGetSafeTask(pBot)->iTask != TASK_PLANTBOMB && BotGetSafeTask(pBot)->iTask != TASK_DEFUSEBOMB)
if(pBot->current_weapon.iId == CS_WEAPON_C4)
{
    if (pBot)
    {
          if (paths[pBot->curr_wpt_index]->flags & W_FL_GOAL)
          {
              pEdict->v.button = (pEdict->v.button | IN_ATTACK);
              pEdict->v.button|=IN_DUCK;
              pEdict->v.button &= ~(IN_JUMP);
              pBot->f_move_speed=0; pBot->f_sidemove_speed=0; 
          }
          else
          BotSelectBestWeapon(pBot);
    }
}
else
pEdict->v.button = 0;

It always causing crash , do you guys see any problems of the code ??? :(

botman 06-03-2004 15:22

Re: See this !!!
 
Is 'pBot' not NULL? Is 'pBot->curr_wpt_index' greater than the size of the 'paths' array (or is it negative)? Is 'pEdit' not NULL?

botman

slash-evil 06-03-2004 15:28

Re: See this !!!
 
I think pBot is NULL

Pierre-Marie Baty 06-03-2004 16:02

Re: See this !!!
 
This piece of code comes from the POD-bot source code ; I recognize it. This code is part of Count Floyd's BotThink(), which is called in StartFrame() for every valid bot, hence pBot CANNOT be NULL.

your problem may come that pBot->curr_wpt_index is uninitialized (I bet it's -1).

slash-evil 07-03-2004 13:17

Re: See this !!!
 
uninitialized ??? How to initialized it ? My C++ skill is extremly bad !

@$3.1415rin 07-03-2004 13:24

Re: See this !!!
 
that's cool, cause now you know what you should do before starting to write a bot :P

slash-evil 07-03-2004 13:29

Re: See this !!!
 
Punishing me ? Whoa , now my bot crash at any point after I start my server since I try to "initialized" the pBot->curr_wpt_index ! Man , I need to redone my bot , so lame !

botman 07-03-2004 16:57

Re: See this !!!
 
www.cplusplus.com

botman

Pierre-Marie Baty 07-03-2004 20:36

Re: See this !!!
 
@slash-evil: now once and for all it's not "your" bot, it's Count Floyd's bot, PERIOD. Changing one or two lines of code in a 10,000 lines of C code bot, doesn't make this bot yours. You're hijacking all the hard work Count Floyd did in his bot and fooling people with your so-called "Slashbot", in which all you did was patching one or two things. I don't mean to take you down but consider that nobody of us ever made the insult to botman to only change 2 lines in the HPB_bot before forking and making our own releases.

Modesty is a quality, "creator of SLASHbot". You did not create anything. So settle down and grab a good tutorial about C/C++; make yourself discrete for one year or two and THEN, show us what you learned. In the meantime, stop drawing the attention to yourself this way. Now I learn you requested to be part of Bots United ? You want us to host the SlashBot website, is that right ?

You'll soon be walking a fine line if you continue this way.

slash-evil 08-03-2004 07:25

Re: See this !!!
 
No ,its wrong , I don't want a website , I am a student , I need to give consetration on my academic , so I am learning now , but really , it is not my bot , I just ripped it , sorry for it !


All times are GMT +2. The time now is 15:43.

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