Windows Iron and Copper Ore in Skull Cavern

JackBlack

Cowpoke
Not sure if this is a bug or intended behaviour.
The code to choose stone type has the following code which is used to pick between iron and copper.
C#:
double chanceForIron = Math.Min(0.5, 0.1 + (double)(this.mineLevel - Math.Min(200, skullCavernMineLevel)) * 0.005);
But as skullCavernMineLevel=this.mineLevel-120 the equation can be rewritten as:
C#:
double chanceForIron = Math.Min(0.5, 0.1 + (double)(120 + skullCavernMineLevel - Math.Min(200, skullCavernMineLevel)) * 0.005);
And then further simplified to:
C#:
double chanceForIron = Math.Min(0.5, 0.7 + (double)(skullCavernMineLevel - Math.Min(200, skullCavernMineLevel)) * 0.005);
As the minimum of 200 and skullCavernMineLevel will always be less than or equal to skullCavernMineLevel, the right side of the overall Min function will always be greater than or equal to 0.7.
This means this value will always be 0.5, and always means that copper ore and iron ore are equally likely to be found.

I feel that if this was intended behaviour, the code would just define the chanceForIron as 0.5, rather than calculating it.
 
Top