From 3c98af04b5ba53b32644db7efc755f581519e63f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Kapu=C5=9Bci=C5=84ski?= Date: Sat, 13 Aug 2022 17:18:14 +0200 Subject: [PATCH] Fixed passing bool to message() --- src/CBot/CBotVar/CBotVarValue.h | 2 +- src/script/scriptfunc.cpp | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/CBot/CBotVar/CBotVarValue.h b/src/CBot/CBotVar/CBotVarValue.h index c305aa2f..0cc83104 100644 --- a/src/CBot/CBotVar/CBotVarValue.h +++ b/src/CBot/CBotVar/CBotVarValue.h @@ -70,7 +70,7 @@ public: return LoadString(TX_NAN); std::ostringstream s; - s << m_val; + s << std::boolalpha << m_val; return s.str(); } diff --git a/src/script/scriptfunc.cpp b/src/script/scriptfunc.cpp index f36121f7..323bea85 100644 --- a/src/script/scriptfunc.cpp +++ b/src/script/scriptfunc.cpp @@ -2859,6 +2859,7 @@ CBotTypResult CScriptFunctions::cMessage(CBotVar* &var, void* user) { if ( var == nullptr ) return CBotTypResult(CBotErrLowParam); if ( var->GetType() != CBotTypString && + var->GetType() != CBotTypBoolean && var->GetType() > CBotTypDouble ) return CBotTypResult(CBotErrBadNum); var = var->GetNext();