Comment 6 for bug 1424945

Revision history for this message
Andre Novellino GouvĂȘa (andre-ng) wrote :

I managed to pinpoint the reason for the bug. It was in the function MapDistanceTo(const CUnit &dst) in unit.h. Here is a fixed version of the function:

 int MapDistanceTo(const CUnit &dst) const
 {
  const CUnitType *distance_unit_type = Container ? Container->Type : Type;
  return MapDistanceBetweenTypes(*distance_unit_type, tilePos, *dst.Type, dst.tilePos);
 }

I have tested it and can confirm this fix works.