I had a similar problem whenI used SDK 2.0. I had the console spammed with
"ALERT pEnt != NULL @ cbase.cpp l.159" (or something similar).

I didn't find the cause of this but I hadn't modify the gamerules... So,
perhaps the
messages you become don't come from the GameRules class but from an other
function.

Just a possibility...

      - Cortex : mapper & coder www.hlalbator.fr.st

----- Original Message -----
From: Christopher Long
To: [EMAIL PROTECTED]
Sent: Wednesday, March 13, 2002 2:42 AM
Subject: Re: [hlcoders] pEnt != NULL and driving me nuts


Well thanks goes to you all but the solution cruise posted worked for me.
I am not doing anything bot related.
Even after using the solution posted by cruise everytime i try to call
UTIL_PlayerByIndex() or the changed one UTIL_CBasePlayerByIndex()
i still get the annoying ALERT pEnt != NULL. I find this very disturbing and
although the original problem is solved these statements still are flowing
around.

All other calls to UTIL_PlayerByIndex() through the sdk work without fail
giving no ALERTS spewing into the console. But anytime i try to do it from
my modified gamerules it gives one for every player not connected so if i
have a 8 player game it'll throw 7 at me each time a player is killed, i
connect or some other function gets called that invokes the RecountTeams()
function.

I'm starting to think maybe i did something a long time ago that was naughty
and never bothered with these alerts before.

As a last question could someone maybe please explain to me why
for(int i = 1; i < gpGlobals->maxClients; i++)
{
   CBasePlayer *plr = UTIL_PlayerByIndex(i);
   if( plr && plr->IsPlayer() && plr->IsAlive() )
   {
   }
}
would generate an ALERT pEnt!=NULL console statement. the alert comes from
cbase.h or .cpp can't remember but its in a debug statement.
What actually does pEnt != NULL mean anyway?

thanks again
Christopher Long
----- Original Message -----
From: Leon Hartwig <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, March 13, 2002 3:41 AM
Subject: RE: [hlcoders] pEnt != NULL and driving me nuts


> This is a multi-part message in MIME format.
> --
> If you are dealing with bots, there are some special considerations
> (you'll probably want to do some stuff in the disconnect callback), but
> for reasons other than what this thread is concerned with.  For your
> problem, you shouldn't need to touch any of that.  Here is an example
> function that I use in Phineas Bot that counts all the valid, connected
> clients:
>
> int UTIL_ClientsInGame( void )
> {
>     int iCount = 0;
>
>     for ( int iIndex = 1; iIndex <= gpGlobals->maxClients; iIndex++ )
> {
>         CBaseEntity * pPlayer = UTIL_PlayerByIndex( iIndex );
>
>         if ( pPlayer == NULL )
>             continue;
>
>         if ( FNullEnt( pPlayer->pev ) )
>             continue;
>
>         if ( FStrEq( STRING( pPlayer->pev->netname ), "" ) )
>             continue;
>
>         iCount++;
>     }
>
>     return iCount;
> }
> --
> [ winmail.dat of type application/ms-tnef deleted ]
> --
>
> _______________________________________________
> To unsubscribe, edit your list preferences, or view the list archives,
please visit:
> http://list.valvesoftware.com/mailman/listinfo/hlcoders
>

_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives,
please visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders


_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives, please visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders

Reply via email to