Update unsummonW to handle new group gruntwork format

This commit is contained in:
Gent S 2020-11-25 11:45:34 -05:00
parent 98ae236c08
commit 85113a667f
1 changed files with 3 additions and 3 deletions

View File

@ -278,7 +278,8 @@ void unsummonWCommand(std::string full, std::vector<std::string>& args, CNSocket
return;
}
if (TableData::RunningMobs.find(npc->appearanceData.iNPC_ID) == TableData::RunningMobs.end()) {
if (TableData::RunningMobs.find(npc->appearanceData.iNPC_ID) == TableData::RunningMobs.end()
&& TableData::RunningGroups.find(npc->appearanceData.iNPC_ID) == TableData::RunningGroups.end()) {
ChatManager::sendServerMessage(sock, "/unsummonW: Closest NPC is not a gruntwork mob.");
return;
}
@ -298,10 +299,9 @@ void unsummonWCommand(std::string full, std::vector<std::string>& args, CNSocket
continue;
}
TableData::RunningMobs.erase(leadNpc->groupMember[i]);
NPCManager::destroyNPC(leadNpc->groupMember[i]);
}
TableData::RunningMobs.erase(leadId);
TableData::RunningGroups.erase(leadId);
NPCManager::destroyNPC(leadId);
ChatManager::sendServerMessage(sock, "/unsummonW: Mob group destroyed.");
return;