mirror of
https://github.com/EQEmu/Server.git
synced 2026-06-25 02:08:23 +00:00
[Commands] Cleanup #reloadtraps Command. (#2126)
* [Commands] Cleanup #reloadtraps Command. - Cleanup messages and logic. - Allow the option to reload/repop traps globally for this command. * Typos.
This commit is contained in:
@@ -2,7 +2,64 @@
|
||||
|
||||
void command_reloadtraps(Client *c, const Seperator *sep)
|
||||
{
|
||||
entity_list.UpdateAllTraps(true, true);
|
||||
c->Message(Chat::Default, "Traps reloaded for %s.", zone->GetShortName());
|
||||
int arguments = sep->argnum;
|
||||
if (!arguments) {
|
||||
entity_list.UpdateAllTraps(true, true);
|
||||
c->Message(
|
||||
Chat::Yellow,
|
||||
fmt::format(
|
||||
"Traps reloaded for {}{}.",
|
||||
fmt::format(
|
||||
"{} ({})",
|
||||
zone->GetLongName(),
|
||||
zone->GetZoneID()
|
||||
),
|
||||
(
|
||||
zone->GetInstanceID() ?
|
||||
fmt::format(
|
||||
" (Instance ID {})",
|
||||
zone->GetInstanceID()
|
||||
) :
|
||||
""
|
||||
)
|
||||
).c_str()
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
bool global = false;
|
||||
|
||||
if (sep->IsNumber(1)) {
|
||||
global = std::stoi(sep->arg[1]) ? true : false;
|
||||
}
|
||||
|
||||
if (!global) {
|
||||
entity_list.UpdateAllTraps(true, true);
|
||||
c->Message(
|
||||
Chat::Yellow,
|
||||
fmt::format(
|
||||
"Traps reloaded for {}{}.",
|
||||
fmt::format(
|
||||
"{} ({})",
|
||||
zone->GetLongName(),
|
||||
zone->GetZoneID()
|
||||
),
|
||||
(
|
||||
zone->GetInstanceID() ?
|
||||
fmt::format(
|
||||
" (Instance ID {})",
|
||||
zone->GetInstanceID()
|
||||
) :
|
||||
""
|
||||
)
|
||||
).c_str()
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
c->Message(Chat::White, "Attempting to reload traps globally.");
|
||||
auto pack = new ServerPacket(ServerOP_ReloadTraps, 0);
|
||||
worldserver.SendPacket(pack);
|
||||
safe_delete(pack);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user