I suspect, the loading of the level destroy alll your previously created entities. Check it in the manual.
Because in your main, there is a state when you put 0 into active_agents, when it happens, in rotate_agent the control reaches the ent_remove statement.
The statement tries to remove an non-existent entity, it gives back an error.
It is only speculation, without any test/try and coding/running.
Last edited by Aku_Aku; 12/07/10 19:31.