Also use the improved noise function for the terrain builder engine.

The old one had some patterns (this is why it was improved for road
placing) Thanks to SynErr to notice it and remind me to port the
change there too (I will probably move both usages in one function,
just need to find a place)
This commit is contained in:
Ali El Gariani 2008-02-17 04:32:26 +00:00
parent 0d1eeb1952
commit de5671f759

View file

@ -818,9 +818,8 @@ bool terrain_builder::rule_matches(const terrain_builder::building_rule &rule,
unsigned int a = (loc.x + 92872973) ^ 918273;
unsigned int b = (loc.y + 1672517) ^ 128123;
unsigned int c = (rule_index + 127390) ^ 13923787;
unsigned int random = a*b*c + a*b + b*c + a*c + a + b + c;
random %= 100;
unsigned int abc = a*b*c + a*b + b*c + a*c + a + b + c;
unsigned int random = (abc*abc) % 100;
if(random > static_cast<unsigned int>(rule.probability)) {
return false;