mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-06 09:09:40 +02:00
Fix crash in VCAI
This commit is contained in:
@@ -133,7 +133,7 @@ TSubgoal CollectRes::whatToDoToTrade()
|
||||
ai->retrieveVisitableObjs(visObjs, true);
|
||||
for(const CGObjectInstance * obj : visObjs)
|
||||
{
|
||||
if(const IMarket * m = IMarket::castFrom(obj, false); m->allowsTrade(EMarketMode::RESOURCE_RESOURCE))
|
||||
if(const IMarket * m = IMarket::castFrom(obj, false); m && m->allowsTrade(EMarketMode::RESOURCE_RESOURCE))
|
||||
{
|
||||
if(obj->ID == Obj::TOWN)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user