ids: 修复 IDS 因为 children 没有清除而 childrenSize 累加超大而崩溃的问题

This commit is contained in:
Calcitem 2020-03-21 02:24:23 +08:00
parent 2642f8f46b
commit df5750d54c
2 changed files with 7 additions and 1 deletions

View File

@ -39,6 +39,13 @@ void StateInfo::generateChildren(const Stack<move_t, MOVE_COUNT> &moves,
assert(size != 0);
if (node->childrenSize > 0) {
for (int i = 0; i < size; i++) {
ai->deleteTree(node->children[i]);
}
node->childrenSize = 0;
}
for (int i = 0; i < size; i++) {
node->addChild(moves[i], ai, this
#ifdef BEST_MOVE_ENABLE

View File

@ -226,7 +226,6 @@ public: /* TODO: Move to private or protected */
// 结点个数;
size_t nodeCount { 0 };
protected:
// 对合法的着法降序排序
void sortMoves(Node *node);