swift-project / pilotclient

Cross-platform cross-simulator pilot client for virtual air traffic networks
https://swift-project.org
GNU General Public License v3.0
91 stars 26 forks source link

Assert caused by null unit in linear interpolator #213

Open oktal3700 opened 1 year ago

oktal3700 commented 1 year ago

https://discord.com/channels/539048679160676382/539486309882789888/1116068371188949034

The assert

ASSERT failure in double __thiscall BlackMisc::PhysicalQuantities::CPhysicalQuantity<
  class BlackMisc::PhysicalQuantities::CLengthUnit,class BlackMisc::PhysicalQuantities::CLength
>::value(class BlackMisc::PhysicalQuantities::CLengthUnit) const

"Cannot convert to null"

D:\a\pilotclient\pilotclient\src\blackmisc\pq\physicalquantity.cpp line 394

Is caused by newAlt having a null unit in CInterpolatorLinear::CInterpolant::interpolatePositionAndAltitude

const CAltitude altitude((newAlt - oldAlt) * tf + oldAlt,
                         oldAlt.getReferenceDatum());

The simulator is FS9, in case that matters.