mirror of
https://github.com/EQEmu/Server.git
synced 2026-08-30 22:06:46 +00:00
[Feature] Add optional is_forced parameter to Zone::Repop (#4046)
* [Feature] Add optional `is_force` parameter to Zone::Repop # Perl - Add `quest::repopzone(is_force)`. # Lua - Add `eq.repop_zone(is_force)`. # Commands - Cleanup `#repop` to use new parameter in `Zone::Repop`. # Notes - Allows operators to forcefully repop a zone without using a second method to clear the respawn timers. * is_forced * Update repop.cpp * Update repop.cpp
This commit is contained in:
+10
-16
@@ -2,23 +2,17 @@
|
||||
|
||||
void command_repop(Client *c, const Seperator *sep)
|
||||
{
|
||||
int arguments = sep->argnum;
|
||||
if (!arguments) {
|
||||
entity_list.ClearAreas();
|
||||
c->Message(Chat::White, "Zone depopped, repopping now.");
|
||||
zone->Repop();
|
||||
return;
|
||||
}
|
||||
const bool is_forced = sep->argnum > 0 ? !strcasecmp(sep->arg[1], "force") : false;
|
||||
|
||||
bool is_force = !strcasecmp(sep->arg[1], "force");
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"Zone depopped, {}repopping now.",
|
||||
is_forced ? "forcefully " : ""
|
||||
).c_str()
|
||||
);
|
||||
|
||||
if (is_force) {
|
||||
zone->ClearSpawnTimers();
|
||||
c->Message(Chat::White, "Zone depopped, forcefully repopping now.");
|
||||
} else {
|
||||
c->Message(Chat::White, "Zone depopped, repopping now.");
|
||||
}
|
||||
|
||||
zone->Repop();
|
||||
entity_list.ClearAreas();
|
||||
zone->Repop(is_forced);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user