1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-04-09 07:13:54 +02:00

Fixed logic discrepancy for (in)visible objects. Fixes #2224, #2225 and possibly more.

This commit is contained in:
DjWarmonger 2015-08-30 09:14:54 +02:00
parent aefe5923fd
commit 6af8db2c69

View File

@ -1659,12 +1659,19 @@ void VCAI::validateVisitableObjs()
std::string errorMsg;
auto shouldBeErased = [&](const CGObjectInstance *obj) -> bool
{
if(!vstd::contains(hlp, obj))
{
logAi->errorStream() << helperObjInfo[obj].name << " at " << helperObjInfo[obj].pos << errorMsg;
if (obj)
return !cb->getObj(obj->id);
else
return true;
}
return false;
//why would we have our local logic for object checks? use cb!
//if(!vstd::contains(hlp, obj))
//{
// logAi->errorStream() << helperObjInfo[obj].name << " at " << helperObjInfo[obj].pos << errorMsg;
// return true;
//}
//return false;
};
//errorMsg is captured by ref so lambda will take the new text