diff --git a/sc2/ChangeLog b/sc2/ChangeLog index bad307e1b..779283553 100644 --- a/sc2/ChangeLog +++ b/sc2/ChangeLog @@ -1,4 +1,5 @@ 0.2: +- Fuel giveaway bug fixed, from steve@blckknght.org - Starmap fuel range calculator and actual consumption matches now - Collision detection is now pixel-perfect (fixes Sa-Matra, BUTT missile, etc) - Fixed lander position sign bug which was introduced by previous fixes diff --git a/sc2/src/sc2code/comm/melnorm/melnorm.c b/sc2/src/sc2code/comm/melnorm/melnorm.c index 577744e6e..330b06fe3 100644 --- a/sc2/src/sc2code/comm/melnorm/melnorm.c +++ b/sc2/src/sc2code/comm/melnorm/melnorm.c @@ -688,7 +688,9 @@ DoBuy (RESPONSE_REF R) else if (PLAYER_SAID (R, buy_25_fuel)) needed_credit = 25; else if (PLAYER_SAID (R, fill_me_up)) - needed_credit = (COUNT)~0; + needed_credit = (capacity - GLOBAL_SIS (FuelOnBoard) + + FUEL_TANK_SCALE - 1) + / FUEL_TANK_SCALE; if (needed_credit == 0) { @@ -700,12 +702,6 @@ DoBuy (RESPONSE_REF R) } else { - if (needed_credit == (COUNT)~0 - && (needed_credit = (capacity / FUEL_TANK_SCALE) - - (GLOBAL_SIS (FuelOnBoard) - / FUEL_TANK_SCALE)) == 0) - needed_credit = 1; - if (GLOBAL_SIS (FuelOnBoard) / FUEL_TANK_SCALE + needed_credit > capacity / FUEL_TANK_SCALE) {