Skip to content

Commit

Permalink
Fix issue 1877. Allow to buy heroes in ally towns
Browse files Browse the repository at this point in the history
Also removed TODO because check already implemented in CGameHandler::hireHero
  • Loading branch information
ArseniyShestakov committed Oct 15, 2015
1 parent fca4dea commit 0d83f6f
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions server/NetPacksServer.cpp
Expand Up @@ -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);
}
Expand Down

0 comments on commit 0d83f6f

Please sign in to comment.