mirror of
https://github.com/OpenFusionProject/OpenFusion.git
synced 2025-11-15 22:50:11 +00:00
Read the NPC ID limit from the XDT
This commit is contained in:
@@ -209,8 +209,10 @@ void summonWCommand(std::string full, std::vector<std::string>& args, CNSocket*
|
||||
return;
|
||||
}
|
||||
|
||||
int limit = NPCManager::NPCData.back()["m_iNpcNumber"];
|
||||
|
||||
// permission & sanity check
|
||||
if (type >= 3314)
|
||||
if (type > limit)
|
||||
return;
|
||||
|
||||
BaseNPC *npc = NPCManager::summonNPC(plr->x, plr->y, plr->z, plr->instanceID, type, true);
|
||||
@@ -540,8 +542,10 @@ void summonGroupCommand(std::string full, std::vector<std::string>& args, CNSock
|
||||
return;
|
||||
}
|
||||
|
||||
int limit = NPCManager::NPCData.back()["m_iNpcNumber"];
|
||||
|
||||
// permission & sanity check
|
||||
if (type >= 3314 || type2 >= 3314 || count > 5) {
|
||||
if (type > limit || type2 > limit || count > 5) {
|
||||
ChatManager::sendServerMessage(sock, "Invalid parameters; double check types and count");
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user