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:
1 parent
fca4deaad2
commit
0d83f6fedd
1 file changed
+3
-4
@@ -209,10 +209,9 @@ bool SetFormation::applyGh( CGameHandler *gh )
|
|||||||
bool HireHero::applyGh( CGameHandler *gh )
|
bool HireHero::applyGh( CGameHandler *gh )
|
||||||
{
|
{
|
||||||
const CGObjectInstance *obj = gh->getObj(tid);
|
const CGObjectInstance *obj = gh->getObj(tid);
|
||||||
|
const CGTownInstance *town = dynamic_cast<const CGTownInstance *>(obj);
|
||||||
if(obj->ID == Obj::TOWN)
|
if(town && PlayerRelations::ENEMIES == gh->getPlayerRelations(obj->tempOwner, gh->getPlayerAt(c)))
|
||||||
ERROR_IF_NOT_OWNS(tid);
|
COMPLAIN_AND_RETURN("Can't buy hero in enemy town!");
|
||||||
//TODO check for visiting hero
|
|
||||||
|
|
||||||
return gh->hireHero(obj, hid,player);
|
return gh->hireHero(obj, hid,player);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user