It seems that this doesn't work. Ok here's my code.

You see: In the second frame, victim points to an entity which has allready been removed so the engine crashes.

Code:
ENTITY* jet = ent_create(...);

function example() {
	wait(1);
	ent_remove(jet);
}

action turret() {
	ENTITY* victim = jet;
	
	...
	while(1)
		if (victim != NULL) {
			victim.LIFE -= time_step; // crash
		}
	}
}



Last edited by Toryno; 07/21/10 20:45. Reason: i wrote an example to the code to make in more unsterstandable

Thanks for reading, thinking, answering wink