1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-29 23:07:48 +02:00

NKAI: fix defense tasks priority evaluation

This commit is contained in:
Andrii Danylchenko
2023-03-19 19:04:12 +02:00
parent 06fcbf891b
commit ab84cb9931
5 changed files with 56 additions and 20 deletions

View File

@@ -299,6 +299,7 @@ void Nullkiller::makeTurn()
void Nullkiller::executeTask(Goals::TTask task)
{
auto start = std::chrono::high_resolution_clock::now();
std::string taskDescr = task->toString();
boost::this_thread::interruption_point();
@@ -307,10 +308,11 @@ void Nullkiller::executeTask(Goals::TTask task)
try
{
task->accept(ai.get());
logAi->trace("Task %s completed in %lld", taskDescr, timeElapsed(start));
}
catch(goalFulfilledException &)
{
logAi->trace("Task %s completed", task->toString());
logAi->trace("Task %s completed in %lld", taskDescr, timeElapsed(start));
}
catch(cannotFulfillGoalException & e)
{