summaryrefslogtreecommitdiff
path: root/src/map/npc.c
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-05-24 23:10:21 +0300
committerAndrei Karas <akaras@inbox.ru>2015-05-24 23:10:21 +0300
commit857c86d93ebd68e5edbbe14ce26a16a967622822 (patch)
treee17717deda4bc0f9e8485aeefd7c164dd18d9407 /src/map/npc.c
parent437f83655d4abe688743978e35a68524684e03a0 (diff)
downloadevol-hercules-857c86d93ebd68e5edbbe14ce26a16a967622822.tar.gz
evol-hercules-857c86d93ebd68e5edbbe14ce26a16a967622822.tar.bz2
evol-hercules-857c86d93ebd68e5edbbe14ce26a16a967622822.tar.xz
evol-hercules-857c86d93ebd68e5edbbe14ce26a16a967622822.zip
map: fix check for correct npc id.
After server update need update this check.
Diffstat (limited to 'src/map/npc.c')
-rw-r--r--src/map/npc.c10
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;
}