From be85c3917f52884efcafaff58678872eb4e1e8ce Mon Sep 17 00:00:00 2001 From: meep-eep Date: Wed, 22 Dec 2004 20:27:03 +0000 Subject: [PATCH] Correct number for combat energy in "Outfit Starship". it used to divide by wait_delay, but in practice wait_delay + 1 is used. Unfortunately, this means if you want integer numbers, you'd have to multiply everything by gcd(5, 7, 9, 11), instead of gcd(4, 6, 8, 10). This would be too big, so I had to use rounded numbers. The number displayed now is the amount of energy gained per second. git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@1432 8092fc87-c524-0410-9efc-e669fe64eaf9 --- sc2/ChangeLog | 1 + sc2/src/sc2code/sis.c | 9 ++++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/sc2/ChangeLog b/sc2/ChangeLog index 11cf660b7..c4665bf7a 100644 --- a/sc2/ChangeLog +++ b/sc2/ChangeLog @@ -1,4 +1,5 @@ Changes towards version 0.4: +- Corrected number for combat energy when outfitting starship. - SvdB - Added dumping planet info to uqmdebug.c - SvdB - Check language.txt for locale, from Zap - Make it possible to specify the config dir on the command line. diff --git a/sc2/src/sc2code/sis.c b/sc2/src/sc2code/sis.c index 136f56e84..1c255ef4c 100644 --- a/sc2/src/sc2code/sis.c +++ b/sc2/src/sc2code/sis.c @@ -544,7 +544,14 @@ DrawFlagshipStats (void) wsprintf (buf, "%4u", 1 + TURN_WAIT - turn_wait); font_DrawText (&t); t.baseline.y += leading; - wsprintf (buf, "%4u", 240 * energy_regeneration / energy_wait); + { + unsigned int energy_per_10_sec = + (((100 * BATTLE_FRAME_RATE * energy_regeneration) / + (1 + energy_wait)) + 5) / 10; + wsprintf (buf, "%2u.%1u", + energy_per_10_sec / 10, + energy_per_10_sec % 10); + } font_DrawText (&t); t.baseline.y += leading; wsprintf (buf, "%4lu", (fuel / FUEL_TANK_SCALE));