I don't think, and I don't see anything wrong. Plus, it works fine if you do like my code above.
In
CBaseEntity *pEntity = CBaseEntity::Instance(ptr->pHit);
Instance() returns
pent->pvPrivateData; and as comment we can read :
Quote:
|
void* pvPrivateData; // Alloced and freed by engine, used by DLLs
|
get_tr2() will return -1 if not there is not hit. I'm not pro at all but I was wondering if the wall is not attributed with a specific index managed by the engine and ptr->pHit would not return 0 in this case. Anyway I really don't know why it crashes. :/
__________________