diff --git a/lib/CGameState.cpp b/lib/CGameState.cpp index 1b9b89a0e..5131ad8d1 100644 --- a/lib/CGameState.cpp +++ b/lib/CGameState.cpp @@ -3281,6 +3281,7 @@ void CPathfinder::calculatePaths(int3 src /*= int3(-1,-1,-1)*/, int movement /*= { assert(hero); assert(hero == getHero(hero->id)); + if(src.x < 0) src = hero->getPosition(false); if(movement < 0) @@ -3303,9 +3304,9 @@ void CPathfinder::calculatePaths(int3 src /*= int3(-1,-1,-1)*/, int movement /*= return; } + //logGlobal->infoStream() << boost::format("Calculating paths for hero %s (adress %d) of player %d") % hero->name % hero % hero->tempOwner; initializeGraph(); - //initial tile - set cost on 0 and add to the queue CGPathNode &initialNode = *getNode(src); initialNode.turns = 0; @@ -3457,7 +3458,7 @@ CGPathNode::EAccessibility CPathfinder::evaluateAccessibility(const TerrainTile { for(const CGObjectInstance *obj : tinfo->visitableObjects) { - if(obj->passableFor(hero->tempOwner)) //special object instance specific passableness flag - overwrites other accessibility flags + if (obj->passableFor(hero->tempOwner)) { ret = CGPathNode::ACCESSIBLE; } diff --git a/lib/mapObjects/CGTownInstance.cpp b/lib/mapObjects/CGTownInstance.cpp index bde370ff7..1a908bdde 100644 --- a/lib/mapObjects/CGTownInstance.cpp +++ b/lib/mapObjects/CGTownInstance.cpp @@ -525,7 +525,7 @@ void CGTownInstance::onHeroLeave(const CGHeroInstance * h) const if (visitingHero == h) { cb->stopHeroVisitCastle(this, h); - logGlobal->warnStream() << h->name << " correctly left town " << name; + //logGlobal->warnStream() << h->name << " correctly left town " << name; } else logGlobal->warnStream() << "Warning, " << h->name << " tries to leave the town " << name << " but hero is not inside."; @@ -912,12 +912,13 @@ bool CGTownInstance::addBonusIfBuilt(BuildingID building, Bonus::BonusType type, void CGTownInstance::setVisitingHero(CGHeroInstance *h) { - if (!(!!visitingHero == !h)) - { - logGlobal->warnStream() << boost::format("Hero visiting town %s is %s ") % name % (visitingHero.get() ? visitingHero->name : "NULL"); - logGlobal->warnStream() << boost::format("New hero will be %s ") % (h ? h->name : "NULL"); - assert(!!visitingHero == !h); - } + //if (!(!!visitingHero == !h)) + //{ + // logGlobal->warnStream() << boost::format("Hero visiting town %s is %s ") % name % (visitingHero.get() ? visitingHero->name : "NULL"); + // logGlobal->warnStream() << boost::format("New hero will be %s ") % (h ? h->name : "NULL"); + // + //} + assert(!!visitingHero == !h); if(h) { diff --git a/lib/rmg/CRmgTemplateZone.cpp b/lib/rmg/CRmgTemplateZone.cpp index 25d516b27..1e2509221 100644 --- a/lib/rmg/CRmgTemplateZone.cpp +++ b/lib/rmg/CRmgTemplateZone.cpp @@ -1393,7 +1393,6 @@ void CRmgTemplateZone::checkAndPlaceObject(CMapGenerator* gen, CGObjectInstance* object->appearance = templates.front(); } - gen->map->addBlockVisTiles(object); gen->editManager->insertObject(object, pos); //logGlobal->traceStream() << boost::format ("Successfully inserted object (%d,%d) at pos %s") %object->ID %object->subID %pos(); }