From 023bf383389c74f378c3a3689d5eafe7313b3577 Mon Sep 17 00:00:00 2001 From: Rubidium Date: Mon, 31 Mar 2025 20:22:43 +0200 Subject: [PATCH] Codefix: std::string_view does not accept nullptr --- src/game/game_text.cpp | 2 +- src/game/game_text.hpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/game/game_text.cpp b/src/game/game_text.cpp index 8e0a4e1132..15c4fd7bdf 100644 --- a/src/game/game_text.cpp +++ b/src/game/game_text.cpp @@ -273,7 +273,7 @@ static void ExtractStringParams(const StringData &data, StringParamsList ¶ms if (*it == nullptr) { /* Skip empty param unless a non empty param exist after it. */ if (std::all_of(it, pcs.consuming_commands.end(), [](auto cs) { return cs == nullptr; })) break; - param.emplace_back(StringParam::UNUSED, 1, nullptr); + param.emplace_back(StringParam::UNUSED, 1); continue; } const CmdStruct *cs = *it; diff --git a/src/game/game_text.hpp b/src/game/game_text.hpp index f85c8aecd3..8c651e3093 100644 --- a/src/game/game_text.hpp +++ b/src/game/game_text.hpp @@ -24,7 +24,7 @@ struct StringParam { uint8_t consumes; std::string_view cmd; - StringParam(ParamType type, uint8_t consumes, std::string_view cmd) : type(type), consumes(consumes), cmd(cmd) {} + StringParam(ParamType type, uint8_t consumes, std::string_view cmd = {}) : type(type), consumes(consumes), cmd(cmd) {} }; using StringParams = std::vector; using StringParamsList = std::vector;