perfect: Init only once
This commit is contained in:
parent
dd8fafacd4
commit
cbd92f9a08
|
@ -2,8 +2,8 @@
|
|||
|
||||
|
||||
// Perfect AI
|
||||
Mill *mill;
|
||||
PerfectAI *ai;
|
||||
Mill *mill = nullptr;
|
||||
PerfectAI *ai = nullptr;
|
||||
|
||||
int perfect_init(void)
|
||||
{
|
||||
|
@ -13,6 +13,10 @@ int perfect_init(void)
|
|||
char databaseDirectory[] = "";
|
||||
#endif
|
||||
|
||||
if (mill != nullptr) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
mill = new Mill();
|
||||
ai = new PerfectAI(databaseDirectory);
|
||||
ai->setDatabasePath(databaseDirectory);
|
||||
|
|
Loading…
Reference in New Issue