Rev 1164 | Rev 1190 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1164 | Rev 1182 | ||
---|---|---|---|
Line 1020... | Line 1020... | ||
1020 | QPoint offset = GlobalSettings::instance()->model()->grid()->indexOf(lif_ptrs[rnd_index]); |
1020 | QPoint offset = GlobalSettings::instance()->model()->grid()->indexOf(lif_ptrs[rnd_index]); |
1021 | ResourceUnit *ru; |
1021 | ResourceUnit *ru; |
1022 | SaplingCell *sc = GlobalSettings::instance()->model()->saplings()->cell(offset, true, &ru); |
1022 | SaplingCell *sc = GlobalSettings::instance()->model()->saplings()->cell(offset, true, &ru); |
1023 | if (sc) { |
1023 | if (sc) { |
1024 | if (SaplingTree *st=sc->addSapling(static_cast<float>(height), static_cast<int>(age), species->index())) |
1024 | if (SaplingTree *st=sc->addSapling(static_cast<float>(height), static_cast<int>(age), species->index())) |
1025 | hits+=std::max(1., ru->resourceUnitSpecies(st->species_index)->species()->saplingGrowthParameters(). |
1025 | hits+=std::max(1., ru->resourceUnitSpecies(st->species_index)->species()->saplingGrowthParameters().representedStemNumberH(st->height)); |
1026 | else
|
1026 | else
|
1027 | hits++; |
1027 | hits++; |
1028 | } else { |
1028 | } else { |
1029 | hits++; // avoid an infinite loop |
1029 | hits++; // avoid an infinite loop |
1030 | }
|
1030 | }
|