mirror of
https://github.com/OpenFusionProject/OpenFusion.git
synced 2024-11-22 21:40:05 +00:00
Fix /unsummonW crash on non-mob NPCs
This commit is contained in:
parent
128aad89d3
commit
4863d29590
@ -284,6 +284,7 @@ void unsummonWCommand(std::string full, std::vector<std::string>& args, CNSocket
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (MobManager::Mobs.find(npc->appearanceData.iNPC_ID) != MobManager::Mobs.end()) {
|
||||||
int leadId = ((Mob*)npc)->groupLeader;
|
int leadId = ((Mob*)npc)->groupLeader;
|
||||||
if (leadId != 0) {
|
if (leadId != 0) {
|
||||||
if (MobManager::Mobs.find(leadId) == MobManager::Mobs.end()) {
|
if (MobManager::Mobs.find(leadId) == MobManager::Mobs.end()) {
|
||||||
@ -306,6 +307,7 @@ void unsummonWCommand(std::string full, std::vector<std::string>& args, CNSocket
|
|||||||
ChatManager::sendServerMessage(sock, "/unsummonW: Mob group destroyed.");
|
ChatManager::sendServerMessage(sock, "/unsummonW: Mob group destroyed.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
ChatManager::sendServerMessage(sock, "/unsummonW: removed mob with type: " + std::to_string(npc->appearanceData.iNPCType) +
|
ChatManager::sendServerMessage(sock, "/unsummonW: removed mob with type: " + std::to_string(npc->appearanceData.iNPCType) +
|
||||||
", id: " + std::to_string(npc->appearanceData.iNPC_ID));
|
", id: " + std::to_string(npc->appearanceData.iNPC_ID));
|
||||||
|
Loading…
Reference in New Issue
Block a user