1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-07-15 01:24:45 +02:00

* CCallback battle calls are more safe now when there is no battle (may prevent some bugs)

* corrected some obstacles entries
* removed two stack corruption bugs
* a few tweaks in battle path/available hexes calculation (more of them is needed)
This commit is contained in:
mateuszb
2009-02-14 13:49:30 +00:00
parent fd07f7f33e
commit b42a7fa87b
5 changed files with 120 additions and 49 deletions

View File

@ -1419,10 +1419,11 @@ void CBattleInterface::hexLclicked(int whichOne)
if(LOCPLINT->cb->battleGetStackByID(activeStack)->creature->isDoubleWide())
{
std::vector<int> acc = LOCPLINT->cb->battleGetAvailableHexes(activeStack, false);
int shiftedDest = whichOne + (LOCPLINT->cb->battleGetStackByID(activeStack)->attackerOwned ? 1 : -1);
if(vstd::contains(acc, whichOne))
giveCommand(2,whichOne,activeStack);
else
giveCommand(2,whichOne + (LOCPLINT->cb->battleGetStackByID(activeStack)->attackerOwned ? 1 : -1),activeStack);
else if(vstd::contains(acc, shiftedDest))
giveCommand(2,shiftedDest,activeStack);
}
else
{