mirror of
https://github.com/vcmi/vcmi.git
synced 2025-07-17 01:32:21 +02:00
Fix wrong cursor assignment for uncovered tiles beyond DD range
This commit is contained in:
@ -644,28 +644,34 @@ void AdventureMapInterface::onTileHovered(const int3 &targetPosition)
|
|||||||
|
|
||||||
if(spellBeingCasted)
|
if(spellBeingCasted)
|
||||||
{
|
{
|
||||||
|
int3 heroPosition = LOCPLINT->localState->getCurrentArmy()->getSightCenter();
|
||||||
|
if (!isInScreenRange(heroPosition, targetPosition))
|
||||||
|
{
|
||||||
|
CCS->curh->set(Cursor::Map::POINTER);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
switch(spellBeingCasted->id)
|
switch(spellBeingCasted->id)
|
||||||
{
|
{
|
||||||
case SpellID::SCUTTLE_BOAT:
|
case SpellID::SCUTTLE_BOAT:
|
||||||
{
|
{
|
||||||
int3 heroPosition = LOCPLINT->localState->getCurrentArmy()->getSightCenter();
|
if(objAtTile && objAtTile->ID == Obj::BOAT)
|
||||||
|
CCS->curh->set(Cursor::Map::SCUTTLE_BOAT);
|
||||||
if(objAtTile && objAtTile->ID == Obj::BOAT && isInScreenRange(heroPosition, targetPosition))
|
else
|
||||||
CCS->curh->set(Cursor::Map::SCUTTLE_BOAT);
|
CCS->curh->set(Cursor::Map::POINTER);
|
||||||
else
|
return;
|
||||||
CCS->curh->set(Cursor::Map::POINTER);
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
case SpellID::DIMENSION_DOOR:
|
case SpellID::DIMENSION_DOOR:
|
||||||
{
|
{
|
||||||
const TerrainTile * t = LOCPLINT->cb->getTileForDimensionDoor(targetPosition, LOCPLINT->localState->getCurrentHero());
|
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)*/)
|
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
|
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
|
else
|
||||||
CCS->curh->set(Cursor::Map::POINTER);
|
CCS->curh->set(Cursor::Map::POINTER);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user