diff --git a/client/GUIClasses.cpp b/client/GUIClasses.cpp index 7a1f5e1f9..a2cb37f33 100644 --- a/client/GUIClasses.cpp +++ b/client/GUIClasses.cpp @@ -371,8 +371,11 @@ void CGarrisonSlot::clickLeft(tribool down, bool previousState) } } + int countLeft = owner->getSelection()->myStack ? owner->getSelection()->myStack->count : 0; + int countRight = myStack ? myStack->count : 0; + GH.pushInt(new CSplitWindow(owner->getSelection()->creature, boost::bind(&CGarrisonInt::splitStacks, owner, _1, _2), - minLeft, minRight, owner->getSelection()->myStack->count, myStack->count)); + minLeft, minRight, countLeft, countRight)); refr = true; } else if(creature != owner->getSelection()->creature) //swap diff --git a/lib/CGameState.cpp b/lib/CGameState.cpp index af4e0a3d2..e566a43a5 100644 --- a/lib/CGameState.cpp +++ b/lib/CGameState.cpp @@ -494,7 +494,10 @@ int CGameState::pickHero(int owner) for (si32 i=firstHero; i