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:
@ -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
|
||||
{
|
||||
|
Reference in New Issue
Block a user