1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-11-28 08:48:48 +02:00

Fix finishing turn while flying over object

This commit is contained in:
nordsoft 2023-08-14 04:33:41 +04:00
parent 0c38187916
commit 380ee41fba

View File

@ -2323,7 +2323,17 @@ bool CGameHandler::moveHero(ObjectInstanceID hid, int3 dst, ui8 teleporting, boo
visitObjectOnTile(t, h);
}
queries.popIfTop(moveQuery);
if(!transit)
{
for(auto topQuery = queries.topQuery(h->tempOwner); true; topQuery = queries.topQuery(h->tempOwner))
{
moveQuery = std::dynamic_pointer_cast<CHeroMovementQuery>(topQuery);
if(moveQuery)
queries.popIfTop(moveQuery);
else
break;
}
}
logGlobal->trace("Hero %s ends movement", h->getNameTranslated());
return result != TryMoveHero::FAILED;
};