.:: Bots United ::.

.:: Bots United ::. (http://forums.bots-united.com/index.php)
-   Bug Reports (http://forums.bots-united.com/forumdisplay.php?f=49)
-   -   Bug-NUM_FOR_EDICT Error: Bad Pointer (http://forums.bots-united.com/showthread.php?t=1586)

Whistler 10-05-2004 14:06

Re: Bug-NUM_FOR_EDICT Error: Bad Pointer
 
Quote:

Originally Posted by sPlOrYgOn
well I have now added...
Code:

int pfnIndexOfEdict (const edict_t *pEdict)
{
  if (FNullEnt (pEdict))
      RETURN_META_VALUE (MRES_SUPERCEDE, NULL);

  RETURN_META_VALUE (MRES_IGNORED, NULL);
}


This will only work if that is a bug in CS :)
calling ENTINDEX() or INDEXENT() in the bot plugin won't get here...

sPlOrYgOn 11-05-2004 01:30

Re: Bug-NUM_FOR_EDICT Error: Bad Pointer
 
Quote:

Originally Posted by Whistler
This will only work if that is a bug in CS :)
calling ENTINDEX() or INDEXENT() in the bot plugin won't get here...

aww :(

on the good side...
I didn't know INDEXENT could cause it too :D
I was only checking ENTINDEX :D

[edit]
another good news might be that I might have found where it is being caused...
and it does have something to do with intense battles..
at least the dying part...
in BotClient.cpp I changed this:
Code:

void BotClient_CS_DeathMsg (void *p, int bot_index)
{
  // This message gets sent when someone got killed

  static int killer_index;
  static int victim_index;
  static edict_t *killer_edict;
  static bot_t *pBot;

  if (state == 0)
      killer_index = *(int *) p; // ENTINDEX() of killer
  else if (state == 1)
      victim_index = *(int *) p; // ENTINDEX() of victim
  else if (state == 2)
  {
      if ((killer_index != 0) && (killer_index != victim_index))
      {
        killer_edict = INDEXENT (killer_index);
        pBot = UTIL_GetBotPointer (killer_edict);

        // is this message about a bot who killed somebody ?
        if (pBot != NULL)
        {
            pBot->pLastVictim = INDEXENT (victim_index);
            pBot->f_shootatdead_time = gpGlobals->time + RANDOM_FLOAT (0.0, 2.0);
        }

        else // Did a human kill a Bot on his team ?
        {
            edict_t *victim_edict = INDEXENT (victim_index);
            pBot = UTIL_GetBotPointer (victim_edict);

            if (pBot != NULL)
              pBot->bDead = TRUE;
        }
      }
  }
}

to:
Code:

void BotClient_CS_DeathMsg (void *p, int bot_index)
{
  // This message gets sent when someone got killed

  static int killer_index;
  static int victim_index;
  static edict_t *killer_edict;
  static bot_t *pBot;

  if (state == 0)
      killer_index = *(int *) p; // ENTINDEX() of killer
  else if (state == 1)
      victim_index = *(int *) p; // ENTINDEX() of victim
  else if (state == 2)
  {
      // check if victim_index is zero...
      // it does it to killer_index so why not victim_index too?
      if ((killer_index != 0) && (victim_index != 0) && (killer_index != victim_index))
      {
        killer_edict = INDEXENT (killer_index);
        pBot = UTIL_GetBotPointer (killer_edict);

        // is this message about a bot who killed somebody ?
        if (pBot != NULL)
        {
            pBot->pLastVictim = INDEXENT (victim_index);
            pBot->f_shootatdead_time = gpGlobals->time + RANDOM_FLOAT (0.0, 2.0);
        }

        else // Did a human kill a Bot on his team ?
        {
            edict_t *victim_edict = INDEXENT (victim_index);
            pBot = UTIL_GetBotPointer (victim_edict);

            if (pBot != NULL)
              pBot->bDead = TRUE;
        }
      }
  }
}

and hopefully that will fix it..
[/edit

biohazerd87 12-05-2004 05:21

Re: Bug-NUM_FOR_EDICT Error: Bad Pointer
 
If you changed this in the latest version of PODbot i am still getting this error to let you know
[EDIT]
My bad i didn't read before i typed thanks for updating PODbot Splorygon

sPlOrYgOn 12-05-2004 05:26

Re: Bug-NUM_FOR_EDICT Error: Bad Pointer
 
so you used R2.1 and still getting the error?
if so...
I SERIOUSLY do NOT know what is wrong..
I've checked every SINGLE call to INDEXENT and ENTINDEX...
They all have a check to make sure that it's not null...

We will probably have to wait for Austin to come help debug this...

biohazerd87 12-05-2004 05:34

Re: Bug-NUM_FOR_EDICT Error: Bad Pointer
 
yeah i am still getting the error after like 2 rounds

sPlOrYgOn 12-05-2004 05:40

Re: Bug-NUM_FOR_EDICT Error: Bad Pointer
 
Only thing i can think of is if theres another way to cause this error besides giving a null ent to INDEXENT or ENTINDEX....

biohazerd87 12-05-2004 05:43

Re: Bug-NUM_FOR_EDICT Error: Bad Pointer
 
Hey wow i just though about this i relized that everytime CS encounters an error it makes an error log. this is the error log it creates everytime it does the NUM_FOR_EDICT

Error:Failed to load dialog file Resource/UI/ClassMenu.res

Function trace:
CGameUI::Start
CGameUI::Initialize
CBaseUI::Start
CBaseUI::Initialize
Host_Init
CFileSystem_Steam::Mount()

Thats it i hope it helps

sPlOrYgOn 12-05-2004 05:47

Re: Bug-NUM_FOR_EDICT Error: Bad Pointer
 
are you sure thats the log to the correct error?
that looks like a steam error...

well anyways any info can be useful...
as long as it's in the right direction..
but I don't know what to do with that info..

Huntkillaz 12-05-2004 12:14

Re: Bug-NUM_FOR_EDICT Error: Bad Pointer
 
thats steam error ..happens without bots too in normal play.....

this error is definatley coz of the bot move or combat when an intense battle happens....i've been playing with them (2.1) for a while with no error...(good :) )i think we need printf fuctions to trace this bug... too bad it's one of those that haapen once in a while :( (for me at least)

biohazerd87 12-05-2004 14:12

Re: Bug-NUM_FOR_EDICT Error: Bad Pointer
 
Yes well i suspected it was it i tested it to make sure i had like 5 of these logs so i played CS again and let it crash and then i had 6 logs so i assumse that was the problem


All times are GMT +2. The time now is 03:32.

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