Heyo,

I'm having some problems with a VSP I'm fiddling with. I've already
asked this here, but I gave it a rest and now I want to give it a go
again.

First, have some code:

CON_COMMAND(testOne, "This command works")
{
   INetChannel *pNetChan =
static_cast<INetChannel*>(engine->GetPlayerNetInfo(engineClient->GetLocalPlayer()));

   if(pNetChan)
   {
                IClient *pClient = static_cast<IClient 
*>(pNetChan->GetMsgHandler());
                Warning(pClient->GetClientName());
   }
}

CON_COMMAND(testTwo, "This command does not work")
{
        INetChannel *pNetChan =
static_cast<INetChannel*>(engineClient->GetNetChannelInfo());

        if(pNetChan)
        {
                //Warning(pNetChan->GetName()); // Works

                IClient *pClient = static_cast<IClient
*>(pNetChan->GetMsgHandler()); // No error here either

                Warning(pClient->GetClientName()); // Grargh! Game crashes, no
matter if I'm on my own server or not.
        }
}

Now, the first CON_COMMAND does not crash. It only works on my own
listen server though, and I want to be able to use it client-side
(there's some background information in my previous mail, but that's
not really relevant to the problem).

The second command does crash, for what reason I don't know. Could
anyone offer any help with this?

Thanks

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

Reply via email to