Fixed wrong CLogMessage constructor being used

nullptr was being implicitly converted to a null C-style string
via the initializer_list constructor of CLogCategoryList.

refs #790
This commit is contained in:
Mathew Sutcliffe
2016-11-06 20:04:21 +00:00
committed by Klaus Basan
parent b5dfd15d66
commit e25785d09b
2 changed files with 4 additions and 1 deletions

View File

@@ -50,6 +50,9 @@ namespace BlackMisc
//! Initializer list constructor.
CLogCategoryList(std::initializer_list<CLogCategory> il) : CSequence<CLogCategory>(il) {}
//! Prevent accidental use of the initializer list constructor.
CLogCategoryList(std::nullptr_t) = delete;
//! Copy assignment.
CLogCategoryList &operator =(const CLogCategoryList &) = default;

View File

@@ -79,7 +79,7 @@ namespace BlackSimPlugin
FS_PBH pbhstrct;
pbhstrct.pbh = positionVelocity.pbh;
int pitch = std::floor(pbhstrct.pitch / CFs9Sdk::pitchMultiplier());
if (pitch < -90 || pitch > 89) { CLogMessage(nullptr).warning("FS9: Pitch value out of limits: %1") << pitch; }
if (pitch < -90 || pitch > 89) { CLogMessage().warning("FS9: Pitch value out of limits: %1") << pitch; }
int bank = std::floor(pbhstrct.bank / CFs9Sdk::bankMultiplier());
// MSFS has inverted pitch and bank angles