Expanding descriptions containing [credits_number] now yeilds a precise value with exactly one decimal point.

git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@2776 127b21dd-08f5-0310-b4b7-95ae10353056
This commit is contained in:
Jens Ayton 2009-11-22 16:13:34 +00:00
parent 1df30db2aa
commit 766258664e
4 changed files with 11 additions and 2 deletions

View File

@ -526,6 +526,8 @@ waitingForStickCallback: 1;
- (void) loadCargoPodsForType:(OOCommodityType)type fromArray:(NSMutableArray *) manifest;
- (NSMutableArray *) shipCommodityData;
- (OOCreditsQuantity) deciCredits;
- (int) random_factor;
- (Random_Seed) galaxy_seed;
- (NSPoint) galaxy_coordinates;

View File

@ -276,6 +276,12 @@ static PlayerEntity *sSharedPlayer = nil;
}
- (OOCreditsQuantity) deciCredits
{
return credits;
}
- (int) random_factor
{
return market_rnd;

View File

@ -23,7 +23,7 @@ MA 02110-1301, USA.
*/
#import "OOMaths.h"
#include "OOMaths.h"
#if OO_PPC

View File

@ -322,7 +322,8 @@ NSString *ExpandDescriptionsWithLocalsForSystemSeedName(NSString *text, Random_S
[all_descriptions setObject:[player commanderLegalStatus_string] forKey:@"commander_legal_status"];
[all_descriptions setObject:[NSString stringWithFormat:@"%@",[player commanderLegalStatus_number]] forKey:@"commander_bounty"];
}
if (pName == nil) pName=[UNIVERSE getSystemName:seed];
[all_descriptions setObject:OOStringFromDeciCredits([player deciCredits], YES, NO) forKey:@"credits_number"];
if (pName == nil) pName = [UNIVERSE getSystemName:seed];
while ([partial rangeOfString:@"["].location != NSNotFound)
{