mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-11 21:01:29 +00:00
Command #npceditmass now lists column options when one isn't properly specified
This commit is contained in:
parent
05e7c473df
commit
bf25937ee0
@ -7,6 +7,7 @@ Akkadius: Implemented command #roambox remove
|
||||
Akkadius: Implemented LUA NPC:SetSimpleRoamBox(box_size, [move_distance], [move_delay]);
|
||||
Akkadius: Implemented Perl $npc->SetSimpleRoamBox(box_size, [move_distance], [move_delay]);
|
||||
Akkadius: Spawngroup data now hot reloads on #repop
|
||||
Akkadius: Command #npceditmass now lists column options when one isn't properly specified
|
||||
|
||||
== 8/11/2019 ==
|
||||
Akkadius: Added bulk edit command #npceditmass <column-to-search> <column-search-value> <change-column> <change-value>
|
||||
|
||||
@ -7426,6 +7426,8 @@ void command_npceditmass(Client *c, const Seperator *sep)
|
||||
bool valid_search_column = false;
|
||||
auto results = database.QueryDatabase(query);
|
||||
|
||||
std::vector <std::string> possible_column_options;
|
||||
|
||||
for (auto row = results.begin(); row != results.end(); ++row) {
|
||||
if (row[0] == change_column) {
|
||||
valid_change_column = true;
|
||||
@ -7433,15 +7435,21 @@ void command_npceditmass(Client *c, const Seperator *sep)
|
||||
if (row[0] == search_column) {
|
||||
valid_search_column = true;
|
||||
}
|
||||
|
||||
possible_column_options.push_back(row[0]);
|
||||
}
|
||||
|
||||
std::string options_glue = ", ";
|
||||
|
||||
if (!valid_search_column) {
|
||||
c->Message(Chat::Red, "You must specify a valid search column. [%s] is not valid", search_column.c_str());
|
||||
c->Message(Chat::Yellow, "Possible columns [%s]", implode(options_glue, possible_column_options).c_str());
|
||||
return;
|
||||
}
|
||||
|
||||
if (!valid_change_column) {
|
||||
c->Message(Chat::Red, "You must specify a valid change column. [%s] is not valid", change_column.c_str());
|
||||
c->Message(Chat::Yellow, "Possible columns [%s]", implode(options_glue, possible_column_options).c_str());
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user