-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Sat, Jun 07, 2003 at 12:22:19PM -0700, James Couzens wrote:
> if (!pPlayer || !pPlayer->IsNetClient())
>
> Why does this logic crash a linux dedicated server?
>

I'm assuming you're using MSVC on windows.  If so, MSVC does not
evaluate boolean expressions according to the ANSI standard. The correct
way to do what you want is:

if( (!pPlayer) || !pPlayer -> IsNetClient())


what you have is basically:

if( ! (pPlayer || !pPlayer ->IsNetClient()), which will crash if pPlayer
is NULL.

        Jonah
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2 (GNU/Linux)

iD8DBQE+47IdflGtzWCyItURApmfAKDcaa/xOEWe+Zifvf5dLCOIQVxQLwCfQbux
Hd9gz1f/cIOeorZ8c4RecOk=
=6yTx
-----END PGP SIGNATURE-----
_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives, please visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders

Reply via email to