.:: Bots United ::.  
filebase forums irc server wiki web
cubebot epodbot fritzbot gravebot grogbot hpbbot ivpbot jkbotti joebot
meanmod podbotmm racc rcbot realbot sandbot shrikebot soulfathermaps waypoints yapb

Go Back   .:: Bots United ::. > Developer's Farm > SDK Programming discussions > Half-Life 1 SDK
Half-Life 1 SDK For developments focused around Half-Life (and its mods) Half-Life

Reply
 
Thread Tools
Problems with Entity scanning
Old
  (#1)
The_Hard_Mission_Guy
This user broke our rules and has been BANNED
 
The_Hard_Mission_Guy's Avatar
 
Status: Offline
Posts: 181
Join Date: May 2006
Default Problems with Entity scanning - 17-07-2006

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?
  
Reply With Quote
Re: Problems with Entity scanning
Old
  (#2)
jeefo
ouch
 
jeefo's Avatar
 
Status: Offline
Posts: 446
Join Date: Nov 2005
Location: Saint-Petersburg
Default Re: Problems with Entity scanning - 17-07-2006

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.
  
Reply With Quote
Re: Problems with Entity scanning
Old
  (#3)
The_Hard_Mission_Guy
This user broke our rules and has been BANNED
 
The_Hard_Mission_Guy's Avatar
 
Status: Offline
Posts: 181
Join Date: May 2006
Default Re: Problems with Entity scanning - 17-07-2006

Hang on ...inserting the code!

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

WOW 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

Last edited by The_Hard_Mission_Guy; 17-07-2006 at 17:01..
  
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
vBulletin Skin developed by: vBStyles.com