1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-06 09:09:40 +02:00

UI now correctly blocks stack rearrangement when it is not our turn

This commit is contained in:
Ivan Savenko
2024-04-27 12:41:08 +03:00
parent 49691ef743
commit 1775caa872

View File

@@ -269,14 +269,22 @@ bool CGarrisonSlot::mustForceReselection() const
{
const CGarrisonSlot * selection = owner->getSelection();
bool withAlly = selection->our() ^ our();
// not our turn - actions are blocked
if (!LOCPLINT->makingTurn)
return true;
if (!creature || !selection->creature)
return false;
// Attempt to take creatures from ally (select theirs first)
if (!selection->our())
return true;
// Attempt to swap creatures with ally (select ours first)
if (selection->creature != creature && withAlly)
return true;
if (!owner->removableUnits)
{
if (selection->upg == EGarrisonType::UPPER)
@@ -315,7 +323,7 @@ void CGarrisonSlot::clickPressed(const Point & cursorPosition)
{
if(creature)
owner->selectSlot(this);
redraw();
owner->redraw();
refr = true;
}
else