Originally posted by ikanreed
what have been deemed \"proper\" C coding practices suggest checking for Null on any returned pointer. games should only make an exception on a case such as incredibly time sensitive operations.
You are certainly correct ikanreed. But unfortunately, in practical terms, that is a very hard guideline to follow. Maybe it?s just me but there always seems to be something lacking in those pointer-less computer languages.
Just to show you how bad that could be I checked the source for the most uses of pointer references in a single line of code. Of the 25,409 lines of code that specifically use \"->\" ?
the winner is ?
its a tie! At nine pointer references in one line:
client\\pscelclient.cpp:758:
if(pos->entity->pcmesh && pos->entity->pcmesh->GetMesh() && pos->entity->pcmesh->GetMesh()->GetMovable())
common\\net\\netbase.cpp:235:
pkt->packet->pktid, pkt->packet->offset, pkt->clientnum, pkt->packet->pktsize,packetlen, pkt->packet->flags);
At least the pscelclient code is trying to check as it goes along.