News:

SimuTranslator
Make Simutrans speak your language.

Tree age problem when starting with year 1 in pak48.Excentrique

Started by Spike, March 01, 2012, 02:23:11 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Spike

Simutrans 111.2.1 has a tree age problem when starting with year 1 in pak48.Excentrique

I'm somewhat certain that version 111.1 did not yet have this problem, but I haven't installed the old version again to test it - just my memory sais it worked before, so I might be wrong there.

Dwachs

This is a tree from the generated map started at year 1?
Parsley, sage, rosemary, and maggikraut.

Spike

I think. I had just started the game, clicked "new map" and then was checking object descriptions. It's not the only tree that has this problem.

I tried to start pak64 at year 1 to see if it's a pak problem, but pak64 didn't let me to. It started at 1400 and at that point tree had a good age display.

Fabio

Trees are created at different ages, IIRC. e.g. if I create a map in 2000 they are not all saplings. If the tree is 20 years old its birth year is 1980. But if year is 1 and year is uint, birth year is not -19 but e.g. 65308/12 =5442. Thus its age is 1   -5442=-5441
In other words I believe there is an overflow if the age is stored in month of birth uint 0    to 65535 and the tree created in year 1 is older than 1 year.
You could check this in code, though.

prissi

fabio nailed it. We need to enforce have a lower limit on tree age then ...

Dwachs

Parsley, sage, rosemary, and maggikraut.