Read the NPC ID limit from the XDT

This commit is contained in:
2020-12-21 01:57:56 +01:00
committed by Gent S
parent 9057f31bff
commit e0808ffcbd
2 changed files with 9 additions and 3 deletions

View File

@@ -498,8 +498,10 @@ void NPCManager::npcSummonHandler(CNSocket* sock, CNPacketData* data) {
sP_CL2FE_REQ_NPC_SUMMON* req = (sP_CL2FE_REQ_NPC_SUMMON*)data->buf;
Player* plr = PlayerManager::getPlayer(sock);
int limit = NPCData.back()["m_iNpcNumber"];
// permission & sanity check
if (plr->accountLevel > 30 || req->iNPCType >= 3314 || req->iNPCCnt > 100)
if (plr->accountLevel > 30 || req->iNPCType >= limit || req->iNPCCnt > 100)
return;
for (int i = 0; i < req->iNPCCnt; i++) {