[GRASS-dev] Problem with r.spread - solved

Hi

there was a problem with r.spread, as identified by Hamish in an
earlier email (see thread "Compile only wildfire modules?").

I managed to get it working and it looks fine to me.

The original code read:

while ( (smaller_child <= *heap_len) &&
          (new_min_cost > heap[smaller_child].min_cost)) {

       heap[i].min_cost = heap[smaller_child].min_cost;
       heap[i].angle = heap[smaller_child].angle;
       heap[i].row = heap[smaller_child].row;
       heap[i].col = heap[smaller_child].col;

and I changed it to:

while ( (smaller_child <= *heap_len) &&
          (smaller_child > 0) &&
          (new_min_cost > heap[smaller_child].min_cost)) {
.
.
.

Could please someone check if that is OK, and if yes submit to the
code repository?

Thanks

Rainer

--
Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation
Biology, UCT), Dipl. Phys. (Germany)

Centre of Excellence for Invasion Biology
Faculty of Science
Natural Sciences Building
Private Bag X1
University of Stellenbosch
Matieland 7602
South Africa