Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Commands] Cleanup #depopzone Command. #2537

Merged
merged 3 commits into from
Nov 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion zone/command.cpp
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ int command_init(void)
command_add("delacct", "[accountname] - Delete an account", AccountStatus::GMLeadAdmin, command_delacct) ||
command_add("delpetition", "[petition number] - Delete a petition", AccountStatus::ApprenticeGuide, command_delpetition) ||
command_add("depop", "[Start Spawn Timer] - Depop your NPC target and optionally start their spawn timer (false by default)", AccountStatus::Guide, command_depop) ||
command_add("depopzone", "Depop the zone", AccountStatus::GMAdmin, command_depopzone) ||
command_add("depopzone", "[Start Spawn Timers] - Depop the zone and optionally start spawn timers (false by default)", AccountStatus::GMAdmin, command_depopzone) ||
command_add("devtools", "[Enable|Disable] - Manages Developer Tools (send no parameter for menu)", AccountStatus::GMMgmt, command_devtools) ||
command_add("disablerecipe", "[Recipe ID] - Disables a Recipe", AccountStatus::QuestTroupe, command_disablerecipe) ||
command_add("disarmtrap", "Analog for ldon disarm trap for the newer clients since we still don't have it working.", AccountStatus::QuestTroupe, command_disarmtrap) ||
Expand Down
17 changes: 15 additions & 2 deletions zone/gm_commands/depopzone.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,20 @@

void command_depopzone(Client *c, const Seperator *sep)
{
zone->Depop();
c->Message(Chat::White, "Zone depoped.");
auto start_spawn_timers = false;

if (sep->IsNumber(1)) {
start_spawn_timers = std::stoi(sep->arg[1]) ? true : false;
}

zone->Depop(start_spawn_timers);

c->Message(
Chat::White,
fmt::format(
"Zone depopped{}.",
start_spawn_timers ? " and spawn timers started" : ""
).c_str()
);
}