1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-09-16 09:26:28 +02:00

Cursor: show battle cursor for garrison if there creature behind

This one fixed issue 1563
This commit is contained in:
ArseniyShestakov
2015-02-22 09:34:02 +03:00
parent c4cbda88ac
commit a6ce45e867

View File

@@ -1604,9 +1604,10 @@ void CAdvMapInt::tileHovered(const int3 &mapPos)
{
const CGGarrison* garrObj = dynamic_cast<const CGGarrison*>(objAtTile); //TODO evil evil cast!
// Show battle cursor for guarded enemy garrisons, otherwise movement cursor.
if (garrObj && garrObj->stacksCount()
&& !LOCPLINT->cb->getPlayerRelations( LOCPLINT->playerID, garrObj->tempOwner) )
// Show battle cursor for guarded enemy garrisons or garrisons have guarding creature behind, otherwise movement cursor.
if (garrObj && ((garrObj->stacksCount()
&& !LOCPLINT->cb->getPlayerRelations( LOCPLINT->playerID, garrObj->tempOwner))
|| guardingCreature))
CCS->curh->changeGraphic(ECursor::ADVENTURE, 5 + turns*6);
else
CCS->curh->changeGraphic(ECursor::ADVENTURE, 9 + turns*6);