[Door Manipulation] Resolve some typos and add a GM check. (#1550)

* [Door Manipulation] Resolve some typos and add a status check.

* Remove Status check and use GetGM() inside devtools check instead.
This commit is contained in:
Kinglykrab 2021-09-22 17:43:01 -04:00 committed by GitHub
parent ca77d22035
commit 7b969173f4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 24 additions and 20 deletions

View File

@ -2287,4 +2287,4 @@ void SharedDatabase::LoadCharacterInspectMessage(uint32 character_id, InspectMes
void SharedDatabase::SaveCharacterInspectMessage(uint32 character_id, const InspectMessage_Struct* message) { void SharedDatabase::SaveCharacterInspectMessage(uint32 character_id, const InspectMessage_Struct* message) {
std::string query = StringFormat("REPLACE INTO `character_inspect_messages` (id, inspect_message) VALUES (%u, '%s')", character_id, EscapeString(message->text).c_str()); std::string query = StringFormat("REPLACE INTO `character_inspect_messages` (id, inspect_message) VALUES (%u, '%s')", character_id, EscapeString(message->text).c_str());
auto results = QueryDatabase(query); auto results = QueryDatabase(query);
} }

View File

@ -9191,7 +9191,7 @@ void Client::SetDisplayMobInfoWindow(bool display_mob_info_window)
bool Client::IsDevToolsEnabled() const bool Client::IsDevToolsEnabled() const
{ {
return dev_tools_enabled && RuleB(World, EnableDevTools); return dev_tools_enabled && GetGM() && RuleB(World, EnableDevTools);
} }
void Client::SetDevToolsEnabled(bool in_dev_tools_enabled) void Client::SetDevToolsEnabled(bool in_dev_tools_enabled)

View File

@ -129,7 +129,7 @@ void DoorManipulation::CommandHandler(Client *c, const Seperator *sep)
std::vector<std::string> move_h_options_negative; std::vector<std::string> move_h_options_negative;
std::vector<std::string> set_size_options_positive; std::vector<std::string> set_size_options_positive;
std::vector<std::string> set_size_options_negative; std::vector<std::string> set_size_options_negative;
for (const auto &move_option : move_options) { for (const auto &move_option : move_options) {
if (move_option == move_x_action) { if (move_option == move_x_action) {
move_x_options_positive.emplace_back( move_x_options_positive.emplace_back(
EQ::SayLinkEngine::GenerateQuestSaylink( EQ::SayLinkEngine::GenerateQuestSaylink(
@ -165,7 +165,7 @@ void DoorManipulation::CommandHandler(Client *c, const Seperator *sep)
EQ::SayLinkEngine::GenerateQuestSaylink( EQ::SayLinkEngine::GenerateQuestSaylink(
fmt::format("#door edit {} -.25", move_option), fmt::format("#door edit {} -.25", move_option),
false, false,
"-.25" ".25"
) )
); );
} }
@ -190,7 +190,7 @@ void DoorManipulation::CommandHandler(Client *c, const Seperator *sep)
} }
for (int move_index = -15; move_index <= 0; move_index += 5) { for (int move_index = -15; move_index <= 0; move_index += 5) {
int value = (move_index == 0 ? 1 : move_index); int value = (move_index == 0 ? -1 : move_index);
move_y_options_negative.emplace_back( move_y_options_negative.emplace_back(
EQ::SayLinkEngine::GenerateQuestSaylink( EQ::SayLinkEngine::GenerateQuestSaylink(
fmt::format("#door edit {} {}", move_option, value), fmt::format("#door edit {} {}", move_option, value),
@ -204,7 +204,7 @@ void DoorManipulation::CommandHandler(Client *c, const Seperator *sep)
EQ::SayLinkEngine::GenerateQuestSaylink( EQ::SayLinkEngine::GenerateQuestSaylink(
fmt::format("#door edit {} -.25", move_option), fmt::format("#door edit {} -.25", move_option),
false, false,
"-.25" ".25"
) )
); );
} }
@ -229,7 +229,7 @@ void DoorManipulation::CommandHandler(Client *c, const Seperator *sep)
} }
for (int move_index = -15; move_index <= 0; move_index += 5) { for (int move_index = -15; move_index <= 0; move_index += 5) {
int value = (move_index == 0 ? 1 : move_index); int value = (move_index == 0 ? -1 : move_index);
move_z_options_negative.emplace_back( move_z_options_negative.emplace_back(
EQ::SayLinkEngine::GenerateQuestSaylink( EQ::SayLinkEngine::GenerateQuestSaylink(
fmt::format("#door edit {} {}", move_option, value), fmt::format("#door edit {} {}", move_option, value),
@ -243,7 +243,7 @@ void DoorManipulation::CommandHandler(Client *c, const Seperator *sep)
EQ::SayLinkEngine::GenerateQuestSaylink( EQ::SayLinkEngine::GenerateQuestSaylink(
fmt::format("#door edit {} -.25", move_option), fmt::format("#door edit {} -.25", move_option),
false, false,
"-.25" ".25"
) )
); );
} }
@ -260,7 +260,7 @@ void DoorManipulation::CommandHandler(Client *c, const Seperator *sep)
} }
for (int move_index = -50; move_index <= 0; move_index += 5) { for (int move_index = -50; move_index <= 0; move_index += 5) {
int value = (move_index == 0 ? 1 : move_index); int value = (move_index == 0 ? -1 : move_index);
move_h_options_negative.emplace_back( move_h_options_negative.emplace_back(
EQ::SayLinkEngine::GenerateQuestSaylink( EQ::SayLinkEngine::GenerateQuestSaylink(
fmt::format("#door edit {} {}", move_option, value), fmt::format("#door edit {} {}", move_option, value),
@ -283,7 +283,7 @@ void DoorManipulation::CommandHandler(Client *c, const Seperator *sep)
} }
for (int move_index = -100; move_index <= 0; move_index += 10) { for (int move_index = -100; move_index <= 0; move_index += 10) {
int value = (move_index == 0 ? 1 : move_index); int value = (move_index == 0 ? -1 : move_index);
set_size_options_negative.emplace_back( set_size_options_negative.emplace_back(
EQ::SayLinkEngine::GenerateQuestSaylink( EQ::SayLinkEngine::GenerateQuestSaylink(
fmt::format("#door edit {} {}", move_option, value), fmt::format("#door edit {} {}", move_option, value),
@ -297,26 +297,30 @@ void DoorManipulation::CommandHandler(Client *c, const Seperator *sep)
// we're passing a move action here // we're passing a move action here
if (!arg3.empty() && StringIsNumber(arg3)) { if (!arg3.empty() && StringIsNumber(arg3)) {
int x_move = 0; float x_move = 0.0f;
int y_move = 0; float y_move = 0.0f;
int z_move = 0; float z_move = 0.0f;
int h_move = 0; float h_move = 0.0f;
int set_size = 0; float set_size = 0.0f;
if (arg2 == move_x_action) { if (arg2 == move_x_action) {
x_move = std::atoi(arg3.c_str()); x_move = std::atof(arg3.c_str());
} }
if (arg2 == move_y_action) { if (arg2 == move_y_action) {
y_move = std::atoi(arg3.c_str()); y_move = std::atof(arg3.c_str());
} }
if (arg2 == move_z_action) { if (arg2 == move_z_action) {
z_move = std::atoi(arg3.c_str()); z_move = std::atof(arg3.c_str());
} }
if (arg2 == move_h_action) { if (arg2 == move_h_action) {
h_move = std::atoi(arg3.c_str()); h_move = std::atof(arg3.c_str());
} }
if (arg2 == set_size_action) { if (arg2 == set_size_action) {
set_size = std::atoi(arg3.c_str()); set_size = std::atof(arg3.c_str());
} }
door->SetLocation( door->SetLocation(