.:: Bots United ::.

.:: Bots United ::. (http://forums.bots-united.com/index.php)
-   Half-Life 1 SDK (http://forums.bots-united.com/forumdisplay.php?f=33)
-   -   Problems with Entity scanning (http://forums.bots-united.com/showthread.php?t=5526)

The_Hard_Mission_Guy 17-07-2006 16:36

Problems with Entity scanning
 
Hello
I'm facing troubles resolving the "classname" member of the edict_t struct , it occurs after I try to loop through the World entities using INDEXENT() , gpGlobals->maxEntities ,which renders no errors so far! but when I try to get the classname of the entity, the server crashes.....
Why is that?

jeefo 17-07-2006 16:41

Re: Problems with Entity scanning
 
Probably entity is null. Use something like this;

PHP Code:

edict_t *ent NULL;

for (
int entIndex 0entIndex gpGlobals->maxEntitiesentIndex++)
{
   
ent INDEXENT (entIndex);

   if (
FNullEnt (ent))
      continue;

   
g_engfuncs.pfnServerPrint (STRING (ent->v.classname));
   
g_engfuncs.pfnServerPrint ("\n");


Should work without a problem.

The_Hard_Mission_Guy 17-07-2006 16:47

Re: Problems with Entity scanning
 
Hang on ...inserting the code!

Compiling....
linking...bla bla bla.........

WOWw00t it works !
so out of more than 1000 , only a few entities truly exist......and the rest is probably popcorn ,LOL
anyways thank you very much ,
Hurray:clap:


All times are GMT +2. The time now is 17:36.

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