I have a series of jet flames attached to a model. Each flame's Entity1 points to the ship it is attached to and it runs code similar to what is listed here:
action front_flame
{
my.entity1 = you; // my.entity1 is the ship that created this flame
While(my.entity1 != null)
{Do_flame_stuff;
wait(1);}
remove(me);
}
The problem is that when the ship that MY.ENTITY1 points to is removed, The flames do not get removed with it and before too long I reach my max_entity count and the engine crashes.
Can someone tell me why MY.ENTITY1 does not turn to null once the ship is gone, or how I can fix this?
Thanks!
- WildCat