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

small fix

This commit is contained in:
mateuszb 2008-04-19 18:08:29 +00:00
parent f9a4c2a5fd
commit 8fca3147b3

View File

@ -323,7 +323,13 @@ bool CGameState::battleMoveCreatureStack(int ID, int dest)
mac[curStack->attackerOwned ? curStack->position+1 : curStack->position-1]=true;
for(int v=0; v<187; ++v)
accessibility[v] = mac[v];
//removing accessibility for side hexes
for(int v=0; v<187; ++v)
if(curStack->attackerOwned ? (v%17)==1 : (v%17)==15)
accessibility[v] = false;
}
if(!accessibility[dest])
return false;
int predecessor[187]; //for getting the Path
for(int b=0; b<187; ++b)
predecessor[b] = -1;
@ -470,6 +476,10 @@ std::vector<int> CGameState::battleGetRange(int ID)
mac[curStack->attackerOwned ? curStack->position+1 : curStack->position-1]=true;
for(int v=0; v<187; ++v)
accessibility[v] = mac[v];
//removing accessibility for side hexes
for(int v=0; v<187; ++v)
if(curStack->attackerOwned ? (v%17)==1 : (v%17)==15)
accessibility[v] = false;
}
int dists[187]; //calculated distances