I running your most recent code, although I may have started the game on the previous version.
Ok, I think I've worked out what causes it. Klaus was my longest serving soldier (the last of my starting 8 to die.) As a result one of only three soldiers, dead or alive with a scrollbar on his missions screen. These are the only soldiers that crash, and only when selecting a mission that was below the starting 15. I hadn't noticed with the live ones because, well they seem less interesting. If any of them die I'm sure I'd head straight to the memorial to pay my respects.
Attempting to select one of those three missions throws a invalid vector<T> subscript which is a std::out_of_range
As I am running my own build of your code, I changed by build profile to debug and had a dig for you.
The error is thrown on the execution of this line:
SoldierDiaryMissionState.cpp Line 100: int missionId = _soldier->getDiary()->getMissionIdList().at(_rowEntry);
Experementing a little it seems _rowEntry gets more and more inaccurate the further you scroll down.
Looking at
SoldierDiaryOverviewState.cpp Line 312: int absoluteRowEntry = _lstDiary->getSelectedRow() + _lstDiary->getScroll();
I find that
_lstDiary->getSelectedRow()
already seems to be respecting scrollbar position. So every time we moved the scrollbar down all our missions would become offset by 1, eventually you moved off the bottom of the array
Change that row to
int absoluteRowEntry = _lstDiary->getSelectedRow()
and everything seems to clear up the problem.
I've included a patch file of the fix in case it makes it easier for you. Scratch the patch file, it wouldn't apply, I was working on a branch with some of my own changes too.
One thing to note, debugging this has drawn attention to the fact that the textList returns to the top after viewing each mission. Any chance of getting it to remember where it was so I don't have to scroll back down to view the next mission?