1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-24 22:14:36 +02:00

Possible fix for evaluate VisitHero (compiler optimization?)

This commit is contained in:
DJWarmonger 2018-08-22 12:32:48 +02:00
parent 2b6bb0f4c6
commit 346796f4f8

View File

@ -75,8 +75,11 @@ float FuzzyHelper::evaluate(Goals::VisitHero & g)
auto obj = ai->myCb->getObj(ObjectInstanceID(g.objid)); //we assume for now that these goals are similar auto obj = ai->myCb->getObj(ObjectInstanceID(g.objid)); //we assume for now that these goals are similar
if(!obj) if(!obj)
return -100; //hero died in the meantime return -100; //hero died in the meantime
//TODO: consider direct copy (constructor?) else
g.setpriority(Goals::VisitTile(obj->visitablePos()).sethero(g.hero).setisAbstract(g.isAbstract).accept(this)); {
auto dummyGoal = Goals::VisitTile(obj->visitablePos()).sethero(g.hero).setisAbstract(g.isAbstract);
g.setpriority(dummyGoal.accept(this));
}
return g.priority; return g.priority;
} }
float FuzzyHelper::evaluate(Goals::GatherArmy & g) float FuzzyHelper::evaluate(Goals::GatherArmy & g)