mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-25 22:42:04 +02:00
fix: time-of-check-to-time-of-use (TOCTOU) race condition in AIMemory::removeInvisibleObjects; a bit of refactoring in RecruitHeroBehavior and some todo comments for later on
This commit is contained in:
@@ -144,7 +144,7 @@ ui64 FuzzyHelper::evaluateDanger(const CGObjectInstance * obj)
|
||||
case Obj::ARTIFACT:
|
||||
case Obj::RESOURCE:
|
||||
{
|
||||
if(!vstd::contains(aiNk->memory->alreadyVisited, obj))
|
||||
if(!vstd::contains(aiNk->memory->alreadyVisited, obj->id))
|
||||
return 0;
|
||||
[[fallthrough]];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user