diff options
author | Andrei Karas <akaras@inbox.ru> | 2015-05-24 23:10:21 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2015-05-24 23:10:21 +0300 |
commit | 857c86d93ebd68e5edbbe14ce26a16a967622822 (patch) | |
tree | e17717deda4bc0f9e8485aeefd7c164dd18d9407 /src | |
parent | 437f83655d4abe688743978e35a68524684e03a0 (diff) | |
download | plugin-857c86d93ebd68e5edbbe14ce26a16a967622822.tar.gz plugin-857c86d93ebd68e5edbbe14ce26a16a967622822.tar.bz2 plugin-857c86d93ebd68e5edbbe14ce26a16a967622822.tar.xz plugin-857c86d93ebd68e5edbbe14ce26a16a967622822.zip |
map: fix check for correct npc id.
After server update need update this check.
Diffstat (limited to 'src')
-rw-r--r-- | src/map/npc.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/map/npc.c b/src/map/npc.c index daa1630..64ee0f3 100644 --- a/src/map/npc.c +++ b/src/map/npc.c @@ -115,5 +115,13 @@ bool enpc_db_checkid(int *idPtr) { const int id = *idPtr; hookStop(); - return ((id >= 46 && id < MAX_NPC_CLASS) || id == HIDDEN_WARP_CLASS || id == INVISIBLE_CLASS || (id > MAX_NPC_CLASS2_START && id < MAX_NPC_CLASS2_END)); + + if (id == HIDDEN_WARP_CLASS || id == INVISIBLE_CLASS) // Special IDs not included in the valid ranges + return true; + if (id >= 45 && id < MAX_NPC_CLASS) // Second subrange + return true; + if (id >= MAX_NPC_CLASS2_START && id < MAX_NPC_CLASS2_END) // Second range + return true; + // Anything else is invalid + return false; } |