mirror of
https://github.com/vcmi/vcmi.git
synced 2024-12-24 22:14:36 +02:00
An attempt to handle spawning objects. However, on a day of double growth, when multiple monsters spawn, game freezes. Looks like engine issue, code is commented out.
This commit is contained in:
parent
b8eddcd9a8
commit
344783efb5
@ -358,6 +358,25 @@ void VCAI::newObject(const CGObjectInstance * obj)
|
||||
NET_EVENT_HANDLER;
|
||||
if(obj->isVisitable())
|
||||
addVisitableObj(obj);
|
||||
|
||||
//AI should reconsider strategy when spawning monsters block the way and free reserved objects
|
||||
|
||||
//FIXME: AI tends to freeze forever on a week of double growth if this code is active
|
||||
//auto safeCopy = reservedHeroesMap;
|
||||
//for (auto hero : safeCopy)
|
||||
//{
|
||||
// auto h = hero.first;
|
||||
// for (auto reservedObj : hero.second)
|
||||
// {
|
||||
// auto pos = reservedObj->visitablePos();
|
||||
// if (!(isAccessibleForHero(pos, h) && isSafeToVisit(h, pos)))
|
||||
// {
|
||||
// erase_if_present (reservedObjs, reservedObj);
|
||||
// for(auto &p : reservedHeroesMap)
|
||||
// erase_if_present (p.second, reservedObj);
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
}
|
||||
|
||||
void VCAI::objectRemoved(const CGObjectInstance *obj)
|
||||
|
Loading…
Reference in New Issue
Block a user