1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-25 22:42:04 +02:00

Stack reversing logic now matches H3

This commit is contained in:
Ivan Savenko
2022-12-18 11:42:02 +02:00
parent 52fc5b3c39
commit 45aa841fb6
6 changed files with 76 additions and 66 deletions

View File

@@ -151,12 +151,12 @@ std::vector<BattleHex> BattleHex::allNeighbouringTiles() const
return ret;
}
signed char BattleHex::mutualPosition(BattleHex hex1, BattleHex hex2)
BattleHex::EDir BattleHex::mutualPosition(BattleHex hex1, BattleHex hex2)
{
for(EDir dir = EDir(0); dir <= EDir(5); dir = EDir(dir+1))
if(hex2 == hex1.cloneInDirection(dir,false))
return dir;
return INVALID;
return NONE;
}
char BattleHex::getDistance(BattleHex hex1, BattleHex hex2)