View Single Post
Re: Permanent crash on cs_bigbrother_beta1
Old
  (#19)
sPlOrYgOn
<-- He did it.
 
sPlOrYgOn's Avatar
 
Status: Offline
Posts: 1,558
Join Date: Jan 2004
Location: Los Angeles, California, USA, North America, Earth, Solar System, Milky Way.
Default Re: Permanent crash on cs_bigbrother_beta1 - 30-05-2004

alright I got the call stack
Quote:
PODBOT_MM! Vector::Vector(class Vector const &) + 13 bytes
PODBOT_MM! BotSetConditions(struct bot_t *) + 4729 bytes
PODBOT_MM! BotThink(struct bot_t *) + 2042 bytes
PODBOT_MM! StartFrame(void) + 1329 bytes
METAMOD! 098cac8b()
SWDS! 06416d39()
SWDS! 06412613()
SWDS! 063c8601()
HLDS! 00401924()
so each time a function is called it gets added to the top?
if so then the screwed up call to Vector is in BotSetConditions
time to look through it...

[edit]
I have now narrowed it down to the check if it is a good idea to throw a nade...
[/edit]

[edit2]
even more specific.. the HE nade checking part...
[/edit2]

[edit3]
I found it!!!
Code:
// Returns all Waypoints within Radius from Position
void WaypointFindInRadius (Vector vecPos, float fRadius, int *pTab, int *iCount)
{
   int i, iMaxCount;
   float distance;

   iMaxCount = *iCount;
   *iCount = 0;

   for (i = 0; i < g_iNumWaypoints; i++)
   {
      distance = (paths[i]->origin - vecPos).Length ();

      if (distance < fRadius)
      {
         *pTab++ = i;
         *iCount++;

         if (*iCount == iMaxCount)
            break;
      }
   }

   *iCount--;
   return;
}
should be
Code:
// Returns all Waypoints within Radius from Position
void WaypointFindInRadius (Vector vecPos, float fRadius, int *pTab, int *iCount)
{
   int i, iMaxCount;
   float distance;

   iMaxCount = *iCount;
   *iCount = 0;

   for (i = 0; i < g_iNumWaypoints; i++)
   {
      distance = (paths[i]->origin - vecPos).Length ();

      if (distance < fRadius)
      {
         *pTab++ = i;
         (*iCount)++;

         if (*iCount == iMaxCount)
            break;
      }
   }

   (*iCount)--;
   return;
}
simple problem of operator precedences
I think it was incrementing the actual address of iCount... which wouldn't be nice since iCount isn't an array...
[/edit3]

Last edited by sPlOrYgOn; 31-05-2004 at 01:38..
  
Reply With Quote