1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-02-03 13:01:33 +02:00

Naah, revert my changes.

This commit is contained in:
DJWarmonger 2018-07-28 09:08:53 +02:00
parent e7cb8d7d17
commit 70549197b6
2 changed files with 5 additions and 8 deletions

View File

@ -1073,16 +1073,13 @@ TSubgoal Goals::CollectRes::whatToDoToTrade()
auto backObj = cb->getTopObj(m->o->visitablePos()); //it'll be a hero if we have one there; otherwise marketplace
assert(backObj);
auto objid = m->o->id.getNum();
if (backObj->tempOwner != ai->playerID)
if (backObj->tempOwner != ai->playerID) //top object not owned
{
return sptr(Goals::GetObj(objid));
return sptr(Goals::GetObj(objid)); //just go there
}
else
else //either it's our town, or we have hero there
{
if (m->o->ID == Obj::TOWN) //just trade remotely using town objid
return sptr(setobjid(objid).setisElementar(true));
else //just go there
return sptr(Goals::GetObj(objid));
return sptr(setobjid(objid).setisElementar(true));
}
}
}

View File

@ -2158,7 +2158,7 @@ void VCAI::tryRealize(Goals::DigAtTile & g)
void VCAI::tryRealize(Goals::CollectRes & g) //trade
{
if(ah->freeResources()[g.resID] >= g.value) //goal is already fulfilled. Why we need this chek, anyway?
if(ah->freeResources()[g.resID] >= g.value) //goal is already fulfilled. Why we need this check, anyway?
throw goalFulfilledException(sptr(g));
if(const CGObjectInstance * obj = cb->getObj(ObjectInstanceID(g.objid), false))