I have a bit of a problem... from the hl project I create a new user
message, that works fine. I grab it using my vgui screen and pass the
data to my function.
I pass the entity index of the sent item. In my case, it's a healthkit.
Well, what I'd like to do is if my function finishes successfully, to
remove the item from the map.
If I put this:
pEnt->Remove();
After I send the message in the hl project, it works. It removes the
entity from the map. However, if I use that same code in the client project:
C_BaseEntity *pEnt = C_BaseEntity::Instance(EntityIndex);
if(pEnt)
{
DevMsg("Item removed: Class: %s, index: %d\n",
pEnt->GetClassname(), pEnt->entindex());
// pEnt->Remove(); // This line crashes
}
It will crash; if I break on it, it doesn't give me any useful
information... it just goes to the RemoveAllPanels function in
vgui_TeamFortressViewport.cpp file.
Funny thing is... using the same line for pEnt in the hl project, the
Classname returned is "item_healthkit" however in the client project,
it's "class CBaseAnimating" but the entindex is fine and proper.
I'll also mention that this is SP only; no MP.
I've tried:
pEnt->Release();
pEnt->Remove();
pEnt->Clear();
pEnt->Term();
None of them work.
--
Kamran A
Get Firefox! Safer, Faster, Better.
<http://www.spreadfirefox.com/?q=affiliates&id=0&t=85>
Down with Internet Explorer! Say "NO!" to Spyware! Use Firefox
_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives, please
visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders