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

Fix wrong cursor assignment for uncovered tiles beyond DD range

This commit is contained in:
Dydzio 2024-03-27 22:48:53 +01:00
parent 4f0a286167
commit 38659abcb8

View File

@ -644,13 +644,18 @@ void AdventureMapInterface::onTileHovered(const int3 &targetPosition)
if(spellBeingCasted)
{
int3 heroPosition = LOCPLINT->localState->getCurrentArmy()->getSightCenter();
if (!isInScreenRange(heroPosition, targetPosition))
{
CCS->curh->set(Cursor::Map::POINTER);
return;
}
switch(spellBeingCasted->id)
{
case SpellID::SCUTTLE_BOAT:
{
int3 heroPosition = LOCPLINT->localState->getCurrentArmy()->getSightCenter();
if(objAtTile && objAtTile->ID == Obj::BOAT && isInScreenRange(heroPosition, targetPosition))
if(objAtTile && objAtTile->ID == Obj::BOAT)
CCS->curh->set(Cursor::Map::SCUTTLE_BOAT);
else
CCS->curh->set(Cursor::Map::POINTER);
@ -659,13 +664,14 @@ void AdventureMapInterface::onTileHovered(const int3 &targetPosition)
case SpellID::DIMENSION_DOOR:
{
const TerrainTile * t = LOCPLINT->cb->getTileForDimensionDoor(targetPosition, LOCPLINT->localState->getCurrentHero());
int3 heroPosition = LOCPLINT->localState->getCurrentArmy()->getSightCenter();
if(t && t->isClear(LOCPLINT->cb->getTile(heroPosition))/* && isInScreenRange(hpos, mapPos)*/)
CCS->curh->set(Cursor::Map::TELEPORT); //TODO: something wrong with beyond east spell range border cursor on arrogance after TP-ing near underground portal on previous day
else
CCS->curh->set(Cursor::Map::POINTER);
return;
}
default:
break;
}
}