----- Original Message -----
From: "Yacketta, Ronald" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, January 02, 2002 9:15 PM
Subject: RE: [hlcoders] Items.cpp (MyTouch)
> What is wrong with this?
>
> while ( (pPlayer = (CBasePlayer*)UTIL_FindEntityByClassname(
> pPlayer, "player" )) != NULL) {
> if ( pPlayer && pPlayer->IsAlive() ) {
> vecSpot = pPlayer->Center();
> if ( vecSpot )
> UTIL_LogPrintf( "x[%d] y[%d]
> z[%d]\n", vecSpot.x, vecSpot.y, vecSpot.z );
> }
> }
>
> Same basic concept/code as in client.cpp... But this crashes *boggle*
I don't think you wanted this...
"if ( vecSpot )"
...I'm not sure what you were checking for. The Center() of the player HAS
to be something, so all values of vecSpot (a Vector) would be valid. Also
these guys...
vecSpot.x, vecSpot.y, vecSpot.z
...are floats (not integers). You want %f in your UTIL_LogPrintf, not %d.
I don't see why that would cause a crash though. You should just get bad
output.
Jeffrey "botman" Broome
_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives, please visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders