Skip to content

Commit

Permalink
Don't auto-return units to refuel if they're converting
Browse files Browse the repository at this point in the history
A converting unit may (e.g. Submersibles in Aviation ruleset) save
 itself from fuel exhaustion by conversion.  In that case, there is
 no need to override the unit's existing orders at turn-end and
 auto-move it to a nearby refueling point (city, carrier, etc.).
So, condition that auto-move code on !converting_fuel_rescue().
  • Loading branch information
ec429 authored and psampathkumar committed Jun 17, 2022
1 parent 18870dc commit 262204e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion server/unittools.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -515,7 +515,8 @@ void player_restore_units(struct player *pplayer)
/* I think this is strongly against the spirit of client goto.
* The problem is (again) that here we know too much. -- Zamar */

if (punit->fuel <= 1 && !is_unit_being_refueled(punit)) {
if (punit->fuel <= 1 && !is_unit_being_refueled(punit)
&& !converting_fuel_rescue(punit)) {
struct unit *carrier;

carrier = transporter_for_unit(punit);
Expand Down

0 comments on commit 262204e

Please sign in to comment.