Right now I have the problem that a removed entity
is not recognized as NULL, but
is like a "ZERO" entity, with positiondata at 0,0,0 for example.
This engine really has some flaws.
if(myTarget!=NULL)
{
if((myTarget.x==0) && (myTarget.z==0) ) {ent_remove(myTarget);}
-> results in a crash, because myTarget is NULL ...
so first its Not Null, then its Null...
Very good engine programming
Removed entities are not NULL. An Entity cannot be NULL. NULL is a value that can be assigned to pointers. Lite-C has no way of finding out where you saved pointers to entities and set them automatically to NULL for you. Your code crashes because myTarget is a vagabonding pointer, not because it is NULL and suddenly not NULL. A value different from NULL does not mean a pointer is necessarily valid.
http://tutorial.3dgamestudio.net/