Skip to content

Commit 23d5fb3

Browse files
committed
Remove std::format usage
1 parent 0758faf commit 23d5fb3

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

src/game/client/components/tclient/scripting.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ class CScriptRunner : CComponentInterfaces
219219
return nullptr;
220220
return GameClient()->m_aClients[Id].m_aClan;
221221
}
222-
throw std::invalid_argument(std::format("No state with name {}", Str));
222+
throw std::string("No state with name '") + Str + std::string("'");
223223
}
224224

225225
public:

src/game/client/components/tclient/scripting/impl.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
#include <dispatchkit/bad_boxed_cast.hpp>
1010
#include <dispatchkit/boxed_cast.hpp>
1111
#include <dispatchkit/proxy_functions.hpp>
12-
#include <format>
1312
#include <variant>
1413

1514
#define CHAISCRIPT_NO_THREADS
@@ -21,7 +20,7 @@ static const auto NAMESPACE_RE = [](chaiscript::Namespace &Re) {
2120
Re["compile"] = chaiscript::var(chaiscript::fun([](const std::string &s) {
2221
const auto R = Regex(s);
2322
if(!R.error().empty())
24-
throw std::format("Failed to compile regex: {}", R.error());
23+
throw std::string("Failed to compile regex: ") + R.error();
2524
return R;
2625
}));
2726
Re["test"] = chaiscript::var(chaiscript::fun(&Regex::test));
@@ -55,7 +54,7 @@ static const char *ReadScript(IStorage *pStorage, const char *pFilename)
5554
const char *pScript;
5655
pScript = pStorage->ReadFileStr(pFilename, IStorage::TYPE_ALL);
5756
if(!pScript || !*pScript)
58-
throw std::format("Failed to open script '{}'", pFilename);
57+
throw std::string("Failed to open script '") + std::string(pFilename) + std::string("'");
5958
return pScript;
6059
}
6160

0 commit comments

Comments
 (0)