1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-23 22:37:55 +02:00

Fix issue 1877. Allow to buy heroes in ally towns

Also removed TODO because check already implemented in CGameHandler::hireHero
This commit is contained in:
ArseniyShestakov
2015-10-15 04:00:21 +03:00
parent fca4deaad2
commit 0d83f6fedd

View File

@@ -209,10 +209,9 @@ bool SetFormation::applyGh( CGameHandler *gh )
bool HireHero::applyGh( CGameHandler *gh )
{
const CGObjectInstance *obj = gh->getObj(tid);
if(obj->ID == Obj::TOWN)
ERROR_IF_NOT_OWNS(tid);
//TODO check for visiting hero
const CGTownInstance *town = dynamic_cast<const CGTownInstance *>(obj);
if(town && PlayerRelations::ENEMIES == gh->getPlayerRelations(obj->tempOwner, gh->getPlayerAt(c)))
COMPLAIN_AND_RETURN("Can't buy hero in enemy town!");
return gh->hireHero(obj, hid,player);
}