Fix for %N using Ranrot() instead of gen_rnd_number() to modify length probabilities, thus making it produce inconsistent results even when system seed is the same.

git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@2489 127b21dd-08f5-0310-b4b7-95ae10353056
This commit is contained in:
Jens Ayton 2009-09-12 23:39:41 +00:00
parent 4631edd2f0
commit 7d17118510

View File

@ -136,6 +136,7 @@ BOOL ScanQuaternionFromString(NSString *wxyzString, Quaternion *outQuaternion)
}
}
BOOL ScanVectorAndQuaternionFromString(NSString *xyzwxyzString, Vector *outVector, Quaternion *outQuaternion)
{
GLfloat xyzwxyz[] = { 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0};
@ -573,7 +574,7 @@ static NSString *NewRandomDigrams(void)
NSMutableString *name = nil;
length = (gen_rnd_number() % 4) + 1;
if ((Ranrot() % 5) < ((length == 1) ? 3 : 1)) ++length; // Make two-letter names rarer and 10-letter names happen sometimes
if ((gen_rnd_number() % 5) < ((length == 1) ? 3 : 1)) ++length; // Make two-letter names rarer and 10-letter names happen sometimes
digrams = [[UNIVERSE descriptions] objectForKey:@"digrams"];
count = [digrams length] / 2;
name = [NSMutableString stringWithCapacity:length * 2];