OK. I think I fixed it, (it hasn't failed since I implemented the following) but I'm not sure if I'm working around a bug.

at the end of the main entity function, (the same function it ran when it was ent_created), Not its event action. I put 2 extra lines in front of the ent_remove, as follows.

Code:
my.event=null;  //try to solve invalid argument bug, ie. turn off events, give them a tick to do them, then remove me
wait(1);        // " " "
ent_remove(me); //flame ran out of fuel.
}


To ensure the event functions all have a chance to run, before removing the entity.
However I shouldn't have to do this as the events either run when me exists, or when me is ent_removed there is no entity to get the event.

Jethro.