mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-12 17:51:28 +00:00
* [Commands] Cleanup #reloadtraps Command. - Cleanup messages and logic. - Allow the option to reload/repop traps globally for this command. * Typos.
66 lines
1.1 KiB
C++
Executable File
66 lines
1.1 KiB
C++
Executable File
#include "../client.h"
|
|
|
|
void command_reloadtraps(Client *c, const Seperator *sep)
|
|
{
|
|
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);
|
|
}
|
|
|