Colobot Forum - International Colobot Community

Full Version: crash when trying to compile a static object
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi, I found a crash "seg fault"

I report it here before creating one more issue as I don't want to be annoying Big Grin

when you try to use and initialize an object as static, it will crash at compile

Code:
public void extern object::test(){
  bug me();
}


class myClass{void myClass(){}}

class bug{
  static myClass omy=new myClass();
  void bug(){}
}

the only way I found to initialize omy (only 1 times) was to pass a fresh object to the constructor :

Code:
public void extern object::test(){
  myClass again();
  bug me(again);
}

class myClass{void myClass(){}}

class bug{
  static myClass omy;

  void bug(){}
  void bug(myClass omy){
    this.omy=omy
  }
}