Campaign crash: enemy ships captured

I hope the explanation is understandable. If something is not clear please ask.

Preliminary information (not the bug):
I am organising my ships in A LOT of fleets when playing campaign.
As you will understand, this may favorize the appereance of this bug.

The bug:
When I attack a world, I win the battle and I capture enemy ships, I observed that the captured ships are always added to my 1st fleet (the most left one, see picture below).
If my 1st fleet (most left one) has at least 1 ship remaining after the battle, no bug will occur.
If my 1st fleet (most left one) is completely destroyed in the battle (no ship left = fleet deleted), the game crashes, because it cannot add the captured ships.

The crash appears when clicking the “OK” button of the “Enemy ships captured” window.

I am able to reproduce it in my current campaign. I made a backup of the campaign to analyse this bug, so I was able to test several fleet configurations.
Version Full 1.55

The bug is still there in version 1.56.

Instructions for reproducing:

Preparing your fleets for the battle

  • Make fleet 1 containing 1 fighter squad (the fewer fighters in the squad the better; this fleet must die)
  • Make a second fleet (or more) with all your other ships (this fleet must survive)
  • When dragging your fleets for the attack, send fleet 1 first, then your second fleet.

Battle outcome

  • Fleet 1 must die
  • Second fleet must survive (and obviously win the battle)
  • You must capture at least 1 ship


  • Orders for fleet 1: Last stand, no Cautious (remember, this fleet must die)
  • Face a medium/big fleet or a fleet with a lot of fighters (it’s more probable to capture ships)
  • Fleet 1 may be a weak frigate or cruiser, if it’s easier to be destroyed than a fighter squad (depending the opponent)

Btw: Not played that much since the new version 1.56, but it’s definately good to have more than just 1 campaign map to choose from. Thanks for this, cliffski.

Interesting, it does sound like a good explanation for a crash, I shall delve into the code.

Hi cliff,

There was no new GSB patch since my last post in this thread, so obviously this bug is still there. And to be sure, I reproduced it again today.
I just wanted to know if you already worked on it and if it can be corrected for patch 1.57 ?

Anyway, I want to thank you for still working on GSB and for even implementing new modding possibilities for the next patch, like custom bullet textures, bullets with aoe, etc. This sounds fantastic.

Thanks! This fixed the bug!

Excellent news! That was a very challenging bug to locate. Cliff wrote an interesting entry about the effort here on his blog. :smiley: