corrected ripeness calculation

develop
PatrikLundell 2020-07-03 15:50:18 +02:00
parent a04c609980
commit 0a2a16d29c
1 changed files with 1 additions and 1 deletions

@ -234,7 +234,7 @@ selectability selectablePlant(const df::plant_raw *plant, bool farming)
// Formula for determination of the variance in plant growth maturation time, determined via disassembly.
// The x and y parameters are in tiles relative to the embark.
bool ripe(int32_t x, int32_t y, int32_t start, int32_t end) {
int32_t time = ((435522653 - (((y + 3) * x + 5) * ((y + 7) * y * 400181475 + 289700012))) & 0x3FFFFFFF) % 2000 + (*cur_year_tick % 403200);
int32_t time = (((435522653 - (((y + 3) * x + 5) * ((y + 7) * y * 400181475 + 289700012))) & 0x3FFFFFFF) % 2000 + *cur_year_tick) % 403200;
return time >= start && (end == -1 || time <= end);
}