mirror of
https://github.com/OpenFusionProject/OpenFusion.git
synced 2024-11-25 22:40:16 +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;
|
||||
}
|
||||
|
||||
if (MobManager::Mobs.find(npc->appearanceData.iNPC_ID) != MobManager::Mobs.end()) {
|
||||
int leadId = ((Mob*)npc)->groupLeader;
|
||||
if (leadId != 0) {
|
||||
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.");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
ChatManager::sendServerMessage(sock, "/unsummonW: removed mob with type: " + std::to_string(npc->appearanceData.iNPCType) +
|
||||
", id: " + std::to_string(npc->appearanceData.iNPC_ID));
|
||||
|
Loading…
Reference in New Issue
Block a user