Prober way to freeEntity

Blitz3D Forums/Blitz3D Programming/Prober way to freeEntity

Jeroen(Posted 2003) [#1]
Hi! Simple question :)

What is the proper way to do a freeEntity only "if the entity exists"?

I tried:

if entity then freeEntity entity

But that is also executed when the entity does exists.
I'd like to avoid errors as "entity does not exist".
Just to be sure, I'd like to reset and free a lot of stuff when the player re-enters the game.

---------
EDIT: Darn, ProPer, not ProBer as mentioned in the post name :)


TeraBit(Posted 2003) [#2]
If entity <> 0 then FreeEntity Entity : Entity = 0

Or some such thing..


Jeroen(Posted 2003) [#3]
Hmmmm yes I tried it, but I still have the error.
Probably it's something in my code that's wrong, I won't bother you with that :)
Thanks!