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

Fix cursor on visiting sea objects from land

This commit is contained in:
Ivan Savenko 2024-01-16 00:12:21 +02:00
parent c839b397e8
commit b9f4c557fa

View File

@ -691,7 +691,7 @@ void AdventureMapInterface::onTileHovered(const int3 &mapPos)
if(pathNode->layer == EPathfindingLayer::LAND)
CCS->curh->set(cursorMove[turns]);
else
CCS->curh->set(cursorSailVisit[turns]);
CCS->curh->set(cursorSail[turns]);
break;
case EPathNodeAction::VISIT:
@ -706,6 +706,15 @@ void AdventureMapInterface::onTileHovered(const int3 &mapPos)
}
else if(pathNode->layer == EPathfindingLayer::LAND)
CCS->curh->set(cursorVisit[turns]);
else if (pathNode->layer == EPathfindingLayer::SAIL &&
objAtTile &&
objAtTile->isCoastVisitable() &&
pathNode->theNodeBefore &&
pathNode->theNodeBefore->layer == EPathfindingLayer::LAND )
{
// exception - when visiting shipwreck located on coast from land - show 'horse' cursor, not 'ship' cursor
CCS->curh->set(cursorVisit[turns]);
}
else
CCS->curh->set(cursorSailVisit[turns]);
break;