1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-06-15 00:05:02 +02:00

Minor changes

This commit is contained in:
nordsoft
2023-04-19 02:11:24 +04:00
parent 22da7a931d
commit 008db447e7
5 changed files with 34 additions and 4 deletions

View File

@ -2364,10 +2364,16 @@ bool CGameHandler::moveHero(ObjectInstanceID hid, int3 dst, ui8 teleporting, boo
{
for (CGObjectInstance *obj : t.visitableObjects)
{
if (obj != h && obj->blockVisit && !obj->passableFor(h->tempOwner))
if(h->boat && !obj->blockVisit && !h->boat->onboardVisitAllowed)
return doMove(TryMoveHero::SUCCESS, this->IGNORE_GUARDS, DONT_VISIT_DEST, REMAINING_ON_TILE);
if (obj != h && obj->blockVisit && !obj->passableFor(h->tempOwner))
{
return doMove(TryMoveHero::BLOCKING_VISIT, this->IGNORE_GUARDS, VISIT_DEST, REMAINING_ON_TILE);
//this-> is needed for MVS2010 to recognize scope (?)
EVisitDest visitDest = VISIT_DEST;
if(h->boat && !h->boat->onboardVisitAllowed)
visitDest = DONT_VISIT_DEST;
return doMove(TryMoveHero::BLOCKING_VISIT, this->IGNORE_GUARDS, visitDest, REMAINING_ON_TILE);
}
}
return false;
@ -2405,6 +2411,7 @@ bool CGameHandler::moveHero(ObjectInstanceID hid, int3 dst, ui8 teleporting, boo
return true;
}
//still here? it is standard movement!
{
@ -2427,6 +2434,9 @@ bool CGameHandler::moveHero(ObjectInstanceID hid, int3 dst, ui8 teleporting, boo
}
else if (blockingVisit())
return true;
if(h->boat && !h->boat->onboardAssaultAllowed)
lookForGuards = IGNORE_GUARDS;
doMove(TryMoveHero::SUCCESS, lookForGuards, visitDest, LEAVING_TILE);
return true;