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

View File

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