1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-01-12 02:28:11 +02:00

Review fixes

This commit is contained in:
Ivan Savenko 2024-06-17 09:43:22 +00:00
parent e699941a39
commit 431b2865a4
2 changed files with 7 additions and 3 deletions

View File

@ -17,8 +17,8 @@ namespace NKAI
struct ClusterObjectInfo
{
float priority = 0;
float movementCost = 0;
float priority = 0.f;
float movementCost = 0.f;
uint64_t danger = 0;
uint8_t turn = 0;
};

View File

@ -1203,7 +1203,10 @@ void AINodeStorage::calculateTownPortalTeleportations(std::vector<CGPathNode *>
std::vector<const ChainActor *> actorsVector(actorsOfInitial.begin(), actorsOfInitial.end());
tbb::concurrent_vector<CGPathNode *> output;
if(false) //if (actorsVector.size() * initialNodes.size() > 1000)
// TODO: re-enable after fixing thread races. See issue for details:
// https://github.com/vcmi/vcmi/pull/4130
#if 0
if (actorsVector.size() * initialNodes.size() > 1000)
{
tbb::parallel_for(tbb::blocked_range<size_t>(0, actorsVector.size()), [&](const tbb::blocked_range<size_t> & r)
{
@ -1216,6 +1219,7 @@ void AINodeStorage::calculateTownPortalTeleportations(std::vector<CGPathNode *>
std::copy(output.begin(), output.end(), std::back_inserter(initialNodes));
}
else
#endif
{
for(auto actor : actorsVector)
{