Originally Posted By: DriftWood
So simply changing the first if(ent_owner) to if(ent_owner != NULL) , Should fix a crash.
If the local pointer is still set to a value, than ent_remove/ptr_remove has failed as the engine should set it to NULL.

I am afraid you are wrong. The engine has no responsability about the variables of your own. It will never change them, as spected. When you declare a pointer in your code it is yours. The object where the pointer points to is another story. ent_owner is a ENTITY* type variable of his own allocated in the stack that contains the address of an entity, no more relation between the pointer and the entity. In fact you can make the pointer point to other entity at any time if desired. When you save the address of an object in a pointer of your own and the object is removed somewhere else, the pointer of your own remains unchanged. In other words, it will never be NULL unless you fill it yourself. It can not be other way. So since the pointer continues pointing to the same address but the object has been removed, it crashes when trying to access to it.

When refered to beginners I was speaking about the target of his template xP