Search and Rescue: fix refueling mission #5383
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Small changes to the search and rescue mission code which fixes two bugs in the refueling mission.
Description
If the mission requires the player to deliver more hydrogen to the stranded ship than the player has in his cargo hold (e.g. if the players cargo hold is too small to load all needed hydrogen), the player is now able to deliver the hydrogen in multiple passes, i.e., deliver hydrogen, fly back to a space port to get more hydrogen, deliver the additional hydrogen, get more hydrogen if needed, and so on, until finished.
Before the fix, the stranded ship would only accept 1t of additional hydrogen in the second and every subsequent pass, even though more hydrogen was available. Now all hydrogen in the cargo space is used in every pass.
This fixes #5238.
The second bug was that, if the player had hydrogen left in his cargo hold after completing the refueling, this unused hydrogen would be deleted upon returning to the star port. This is now also fixed, unused hydrogen is not touched.
Remarks
Both bugs are simple copy-and-paste errors that seem to have been present ever since the search-and-rescue mission was added to pioneer.
Tested with own saved game and with the savefile from Search and Rescue Fueling mission breaks after first trip. #5238.
It seems that in the search and rescue code it was also intended that the player could deliver replacement crew to a stranded ship in multiple passes. However, this is not possible in the current pioneer version, since when accepting the rescue mission it is checked that the player has at least as many (free) passenger cabins as there are replacement crew members. If the player would be able to accept the mission with fewer cabins (one free cabin minimum), then in principle a multi pass crew transfer would be possible. But I have not checked that this actually works.