mirror of
https://github.com/vcmi/vcmi.git
synced 2024-12-24 22:14:36 +02:00
Additional check
This commit is contained in:
parent
9427dacc5d
commit
6797c374ed
@ -2310,13 +2310,19 @@ bool CGameHandler::arrangeStacks( ObjectInstanceID id1, ObjectInstanceID id2, ui
|
||||
|
||||
if(what==1) //swap
|
||||
{
|
||||
if ( ((s1->tempOwner != player && s1->tempOwner != PlayerColor::UNFLAGGABLE) && s1->getStackCount(p1)) //why 254??
|
||||
if ( ((s1->tempOwner != player && s1->tempOwner != PlayerColor::UNFLAGGABLE) && s1->getStackCount(p1))
|
||||
|| ((s2->tempOwner != player && s2->tempOwner != PlayerColor::UNFLAGGABLE) && s2->getStackCount(p2)))
|
||||
{
|
||||
complain("Can't take troops from another player!");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (sl1.army == sl2.army && sl1.slot == sl2.slot)
|
||||
{
|
||||
complain("Cannot swap stacks - slots are the same!");
|
||||
return false;
|
||||
}
|
||||
|
||||
swapStacks(sl1, sl2);
|
||||
}
|
||||
else if(what==2)//merge
|
||||
|
Loading…
Reference in New Issue
Block a user