mate_threat to search.cpp