hi i'm creating a game in which the player has a 'fireball' spell that is supposed to wreak havoc on enemies

unfortunately the engine crashes as soon as the fireball hits something..
i'm using lite-c for programming.. here is the code for creation and subsequent removal of the fireball..
//code start
ent_create("fireball.mdl",my.x,glow_me);
// this function creates the fireball and glow_me moves it
action glow_me()
{
set(my,TRANSLUCENT);
set(my,BRIGHT);
my.alpha=80;
set(my,LIGHT);
my.lightrange=300;
my.red=255; my.blue=64; my.green=64;
you=player;
my.pan=your.pan;
my.tilt = camera.tilt+25;
firemovement[1]=-2*cos(my.pan); firemovement[0]=2*sin(my.pan); firemovement[2]=0.5*sin(my.tilt);
// this is due to some axis interchange i forgot to take care of.. x and y are interchanged
while(1)
{
move_mode = IGNORE_ME+IGNORE_YOU+IGNORE_PASSABLE;
ballc = ent_move(firemovement,vector(0,0,0)); //crash coming!!
if(ballc==0){ ent_remove(me); //crash here!!!}
wait(1);
}
}
// code end
this is supposed to remove the fireball as soon as 'ballc' goes to zero when the fireball collides with something. But it crashes the engine for some reason..
if i use something else inside the statement eg if(ballc==0){ my.scale_x=5;} this works fine.. how can i remove the fireball on collision? don wanna leave it there for the rest of the level
