avoid type conversion warning in VS2019

This commit is contained in:
Enno Rehling 2020-12-06 16:02:54 +01:00
parent 860fcfacbe
commit 1507090300
1 changed files with 2 additions and 3 deletions

View File

@ -151,9 +151,8 @@ static void use_default(rawmaterial * res, const region * r, int amount)
assert(res->amount > 0 && amount >= 0 && amount <= res->amount); assert(res->amount > 0 && amount >= 0 && amount <= res->amount);
res->amount -= amount; res->amount -= amount;
while (res->amount == 0) { while (res->amount == 0) {
double modifier = long rn = ((rng_int() % (SHIFT * 2 + 1)) - SHIFT) * ((rng_int() % (SHIFT * 2 + 1)) - SHIFT);
1.0 + ((rng_int() % (SHIFT * 2 + 1)) - SHIFT) * ((rng_int() % (SHIFT * 2 + double modifier = 1.0 + rn / 10000.0;
1)) - SHIFT) / 10000.0;
int i; int i;
for (i = 0; r->terrain->production[i].type; ++i) { for (i = 0; r->terrain->production[i].type; ++i) {