Help has moved to the Planio platform. All logins and passwords remained the same. All users will be able to login and use Redmine just as before. Read more...

Bug #824099

path_finding assert '1 << (8 * sizeof(node1->cost_to_here[dir])) > cost + 2' failing

Added by Marko Lindqvist almost 3 years ago. Updated almost 3 years ago.

Start date:
Due date:
% Done:


Estimated time:


With units with "Coast" unit type flag in play, I got bunch of '1 << (8 * sizeof(node1->cost_to_here[dir])) > cost + 2' assert failures from path finding.
cost_to_here is a unsigned char array, meaning cost values can be 255 at max. That sounds like a low limit. Maybe there's a problem even with non
"Coast" units on large maps -> problem also in stable branches?


#1 Updated by Marko Lindqvist almost 3 years ago

Failing assert is not caused by too small storage (though I still think it's a bug, and raised separate Bug #824102 about it), but an extremely large cost value that is being assigned there. I'm debugging where that value comes from.

#2 Updated by Marko Lindqvist almost 3 years ago

The extremely high cost value is FC_INFINITY from tile_move_cost_ptrs(), indicating that all the move points are spent on that move. The only case where it's currently used is when disembarking from transport and slow_invasion is on.

Handling of that case attached.

For NEWS: This was in fuel map handling, so affected path finding only when fuel was in play (though in the particular case where this was first found it was the transport of the amphibious move that had fuel, and disembarking was performed by the cargo of the same amphibious move, i.e., they were not the same unit)

#3 Updated by Marko Lindqvist almost 3 years ago

  • Status changed from Resolved to Closed
  • Assignee set to Marko Lindqvist

Also available in: Atom PDF