Skip to content

Commit d7907e4

Browse files
committed
StoreCommands (2099) - Use kCodeTags.tag instead of custom tag reader
1 parent d5f00c3 commit d7907e4

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

Diff for: src/game_interpreter.cpp

+7-2
Original file line numberDiff line numberDiff line change
@@ -5099,7 +5099,6 @@ bool Game_Interpreter::CommandStoreCommands(lcf::rpg::EventCommand const& com) {
50995099
}
51005100

51015101
std::string rawCommand = " ";
5102-
Constants constList;
51035102

51045103
const auto& list = evtType == 1 ? common_event->GetList() : page->event_commands;
51055104
int index = 0;
@@ -5122,8 +5121,14 @@ bool Game_Interpreter::CommandStoreCommands(lcf::rpg::EventCommand const& com) {
51225121
std::string preffix(list[i].indent, ' ');
51235122
std::string suffix = i < list.size() - 1 ? "\n" : "";
51245123

5124+
auto cmd_tag = lcf::rpg::EventCommand::kCodeTags.tag(list[i].code);
5125+
std::string command_id;
5126+
5127+
if (!cmd_tag) command_id = std::to_string(list[i].code);
5128+
else command_id = cmd_tag;
5129+
51255130
rawCommand += fmt::format("{}${}, \"{}\", [{}], {};{}",
5126-
preffix, constList.get("EventCode", std::to_string(list[i].code), 1), inputString, ss.str(), list[i].indent, suffix);
5131+
preffix, command_id, inputString, ss.str(), list[i].indent, suffix);
51275132
}
51285133

51295134
Game_Strings::Str_Params str_params = { targetStrVar,0, 0 };

0 commit comments

Comments
 (0)