- Value value_draw(Thread* thisThread) {
- return VALUE_DRAW + Value(2 * (thisThread->nodes & 1) - 1);
- }
-
- // Check if the current thread is in a search explosion
- ExplosionState search_explosion(Thread* thisThread) {
-
- uint64_t nodesNow = thisThread->nodes;
- bool explosive = thisThread->doubleExtensionAverage[WHITE].is_greater(2, 100)
- || thisThread->doubleExtensionAverage[BLACK].is_greater(2, 100);
-
- if (explosive)
- thisThread->nodesLastExplosive = nodesNow;
- else
- thisThread->nodesLastNormal = nodesNow;
-
- if ( explosive
- && thisThread->state == EXPLOSION_NONE
- && nodesNow - thisThread->nodesLastNormal > 6000000)
- thisThread->state = MUST_CALM_DOWN;
-
- if ( thisThread->state == MUST_CALM_DOWN
- && nodesNow - thisThread->nodesLastExplosive > 6000000)
- thisThread->state = EXPLOSION_NONE;
-
- return thisThread->state;
+ Value value_draw(const Thread* thisThread) {
+ return VALUE_DRAW - 1 + Value(thisThread->nodes & 0x2);