1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-01-24 03:47:18 +02:00

* version set to 0.61

* Splitting: when moving slider to the right so that 0 is left in old slot the army is moved.
This commit is contained in:
Michał W. Urbańczyk 2008-06-06 12:35:23 +00:00
parent 78d5839f4c
commit 608dc62ee8

View File

@ -644,7 +644,7 @@ int CCallback::splitStack(const CGObjectInstance *s1, const CGObjectInstance *s2
if(!val)
return -1;
CCreatureSet *S1 = const_cast<CCreatureSet*>(getGarrison(s1)), *S2 = const_cast<CCreatureSet*>(getGarrison(s2));
if ((S1->slots[p1].second<=val) && (true /*we are allowed to*/))
if ((S1->slots[p1].second<val) && (true /*we are allowed to*/))
{
return -1;
}
@ -652,6 +652,8 @@ int CCallback::splitStack(const CGObjectInstance *s1, const CGObjectInstance *s2
S2->slots[p2].first = S1->slots[p1].first;
S2->slots[p2].second = val;
S1->slots[p1].second -= val;
if(!S1->slots[p1].second) //if we've moved all creatures
S1->slots.erase(p1);
if(s1->tempOwner<PLAYER_LIMIT)