From e26eba8e039caea91ca17382835e29e528dd8659 Mon Sep 17 00:00:00 2001 From: Kinglykrab <89047260+Kinglykrab@users.noreply.github.com> Date: Fri, 6 May 2022 22:13:16 -0400 Subject: [PATCH] [Commands] Cleanup #npctype_cache Command. (#2109) * [Commands] Cleanup #npctype_cache Command. - Cleanup messages and logic. - Loop was returning as soon as it found first ID, so you couldn't use the spaced ID list functionality at all. * Remove command. --- zone/command.cpp | 2 -- zone/command.h | 1 - zone/gm_commands/npctype_cache.cpp | 27 --------------------------- 3 files changed, 30 deletions(-) delete mode 100755 zone/gm_commands/npctype_cache.cpp diff --git a/zone/command.cpp b/zone/command.cpp index cae1791a3..6550531ad 100755 --- a/zone/command.cpp +++ b/zone/command.cpp @@ -256,7 +256,6 @@ int command_init(void) command_add("npcshout", "[Message] - Make your NPC target shout a message.", AccountStatus::GMLeadAdmin, command_npcshout) || command_add("npcspawn", "[create/add/update/remove/delete] - Manipulate spawn DB", AccountStatus::GMAreas, command_npcspawn) || command_add("npcstats", "- Show stats about target NPC", AccountStatus::QuestTroupe, command_npcstats) || - command_add("npctype_cache", "[id] or all - Clears the npc type cache for either the id or all npcs.", AccountStatus::GMImpossible, command_npctype_cache) || command_add("npctypespawn", "[NPC ID] [Faction ID] - Spawn an NPC by ID from the database with an option of setting its Faction ID", AccountStatus::Steward, command_npctypespawn) || command_add("nudge", "- Nudge your target's current position by specific values", AccountStatus::QuestTroupe, command_nudge) || command_add("nukebuffs", "[Beneficial|Detrimental|Help] - Strip all buffs by type on you or your target (no argument to remove all buffs)", AccountStatus::Guide, command_nukebuffs) || @@ -1299,7 +1298,6 @@ void command_bot(Client *c, const Seperator *sep) #include "gm_commands/npcshout.cpp" #include "gm_commands/npcspawn.cpp" #include "gm_commands/npcstats.cpp" -#include "gm_commands/npctype_cache.cpp" #include "gm_commands/npctypespawn.cpp" #include "gm_commands/nudge.cpp" #include "gm_commands/nukebuffs.cpp" diff --git a/zone/command.h b/zone/command.h index 5dff662ff..6a7b13bba 100644 --- a/zone/command.h +++ b/zone/command.h @@ -166,7 +166,6 @@ void command_npcsay(Client *c, const Seperator *sep); void command_npcshout(Client *c, const Seperator *sep); void command_npcspawn(Client *c, const Seperator *sep); void command_npcstats(Client *c, const Seperator *sep); -void command_npctype_cache(Client *c, const Seperator *sep); void command_npctypespawn(Client *c, const Seperator *sep); void command_nudge(Client *c, const Seperator *sep); void command_nukebuffs(Client *c, const Seperator *sep); diff --git a/zone/gm_commands/npctype_cache.cpp b/zone/gm_commands/npctype_cache.cpp deleted file mode 100755 index 27cc45429..000000000 --- a/zone/gm_commands/npctype_cache.cpp +++ /dev/null @@ -1,27 +0,0 @@ -#include "../client.h" - -void command_npctype_cache(Client *c, const Seperator *sep) -{ - if (sep->argnum > 0) { - for (int i = 0; i < sep->argnum; ++i) { - if (strcasecmp(sep->arg[i + 1], "all") == 0) { - c->Message(Chat::White, "Clearing all npc types from the cache."); - zone->ClearNPCTypeCache(-1); - } - else { - int id = atoi(sep->arg[i + 1]); - if (id > 0) { - c->Message(Chat::White, "Clearing npc type %d from the cache.", id); - zone->ClearNPCTypeCache(id); - return; - } - } - } - } - else { - c->Message(Chat::White, "Usage:"); - c->Message(Chat::White, "#npctype_cache [npctype_id] ..."); - c->Message(Chat::White, "#npctype_cache all"); - } -} -