1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-03-25 21:38:59 +02:00

Do not consider corpses for movement range display (#1476)

This commit is contained in:
Ivan Savenko 2023-01-20 15:16:28 +02:00 committed by GitHub
parent 21c053ba87
commit 785a9aadcd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -211,11 +211,11 @@ std::set<BattleHex> BattleFieldController::getHighlightedHexesStackRange()
for(BattleHex hex : set)
result.insert(hex);
// display the movement shadow of the stack at b (i.e. stack under mouse)
const CStack * const shere = owner.curInt->cb->battleGetStackByPos(hoveredHex, false);
if(shere && shere != owner.stacksController->getActiveStack() && shere->alive())
// display the movement shadow of stack under mouse
const CStack * const hoveredStack = owner.curInt->cb->battleGetStackByPos(hoveredHex, true);
if(hoveredStack && hoveredStack != owner.stacksController->getActiveStack())
{
std::vector<BattleHex> v = owner.curInt->cb->battleGetAvailableHexes(shere, true, nullptr);
std::vector<BattleHex> v = owner.curInt->cb->battleGetAvailableHexes(hoveredStack, true, nullptr);
for(BattleHex hex : v)
result.insert(hex);
}