From 95ef96c00bee66c09d603c72adf84ea43ec88e65 Mon Sep 17 00:00:00 2001 From: meep-eep Date: Wed, 4 Dec 2002 00:05:25 +0000 Subject: [PATCH] Fuel give-away bug fixed, from BlckKnght. git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@307 8092fc87-c524-0410-9efc-e669fe64eaf9 --- sc2/ChangeLog | 1 + sc2/src/sc2code/comm/melnorm/melnorm.c | 10 +++------- 2 files changed, 4 insertions(+), 7 deletions(-) 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) {