the3dfxdude/7kaa — pull request #28 by sraboy (2014-04-12 23:27:06+00:00)
Title: Resolves bug with units pathfinding to a now dead ship

Re: http://www.7kfans.com/forums/viewtopic.php?f=13&t=529.

Now that the funny DEBUG loading thing is resolved with Pull 22 can we take care of this one?

If a game is saved after a ship's hit points are set to 0, but before the sprites are destroyed or set to ACTION_DIE or SPRITE_DIE, they're loaded with the game and are not resolved. The only check done by UnitArray::assign_to_ship() is to ensure the values aren't -1 before using them for assignment. The crash happens on line 1057.

The fix is that the units simply move_to() the coast near where the ship was just like they would if the ship couldn't carry units.