It just freezes (and if done on create actor)dosn't draw anything, and when I press escape, it exits Game Editor.
I also have another instsnce where this happens, when I activate the function
- Code: Select all
void Shoot(int xpo, int ypo)
{
char *col;
int ST = getclone(SNam)->ShotType;
strcpy(col, getactor(xpo, ypo)->clonename);
if(getclone(col)->Type==Unit && getclone(col)->Side!=Side)
{
strcpy(col, getactor(xpo, ypo)->clonename);
switch(getclone(col)->HitType)
{
case G:
if(getShot(1, ST))
{
CreateActor("GBang", "Ground_Bang", "no parent", "no path", xpo, ypo, true);
Move=0;
CollisionState(SNam, DISABLE);
ChangeParent(SNam, "no parent");
getclone(SNam)->Sel=0;
getclone(SNam)->r=150;
getclone(SNam)->g=150;
getclone(SNam)->b=150;
EventDisable("Event Actor", EVENTKEYDOWN);
}
break;
case A:
if(getShot(2, ST))
{
CreateActor("ABang", "Air_Bang", "no parent", "no path", xpo, ypo, true);
Move=0;
CollisionState(SNam, DISABLE);
ChangeParent(SNam, "no parent");
getclone(SNam)->Sel=0;
getclone(SNam)->r=150;
getclone(SNam)->g=150;
getclone(SNam)->b=150;
EventDisable("Event Actor", EVENTKEYDOWN);
}
break;
case S:
if(getShot(3, ST))
{
CreateActor("SBang", "Sea_Bang", "no parent", "no path", xpo, ypo, false);
Move=0;
CollisionState(SNam, DISABLE);
ChangeParent(SNam, "no parent");
getclone(SNam)->Sel=0;
getclone(SNam)->r=150;
getclone(SNam)->g=150;
getclone(SNam)->b=150;
}
break;
case U:
if(getShot(4, ST))
{
CreateActor("UBang", "Sub_Bang", "no parent", "no path", xpo, ypo, false);
Move=0;
CollisionState(SNam, DISABLE);
ChangeParent(SNam, "no parent");
getclone(SNam)->Sel=0;
getclone(SNam)->r=150;
getclone(SNam)->g=150;
getclone(SNam)->b=150;
EventDisable("Event Actor", EVENTKEYDOWN);
}
}
}
}
in which SNam is an actor's clonename; getShot(1, ST) should return 1; getShot(2, ST) should return 0; getShot(3, ST) should return 1 and getShot(4, ST) should return 0 and G, A, S, U and Unit are constants.
Does anyone know why this happens and how it can be fixed?