summaryrefslogtreecommitdiff
path: root/src/map/instance.c
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-10-22 17:46:39 +0300
committerAndrei Karas <akaras@inbox.ru>2015-10-24 16:15:06 +0300
commit7b8923a6bc228fee37189a6ce99934ad2976807d (patch)
tree6a193606c833e736dd8433a3aca197eae5c19da4 /src/map/instance.c
parent92d9b4919517d3b7121bd1ebaa4fb75fc6761a7c (diff)
downloadhercules-7b8923a6bc228fee37189a6ce99934ad2976807d.tar.gz
hercules-7b8923a6bc228fee37189a6ce99934ad2976807d.tar.bz2
hercules-7b8923a6bc228fee37189a6ce99934ad2976807d.tar.xz
hercules-7b8923a6bc228fee37189a6ce99934ad2976807d.zip
Fix crash in instance.c
Diffstat (limited to 'src/map/instance.c')
-rw-r--r--src/map/instance.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/map/instance.c b/src/map/instance.c
index 545ffe1e7..45e407dfc 100644
--- a/src/map/instance.c
+++ b/src/map/instance.c
@@ -94,9 +94,9 @@ int instance_create(int owner_id, const char *name, enum instance_owner_type typ
}
if( type != IOT_NONE && *icptr ) {
- ARR_FIND(0, *icptr, i, strcmp(instance->list[iptr[i]].name,name) == 0 );
+ ARR_FIND(0, *icptr, i, iptr[i] != -1 && strcmp(instance->list[iptr[i]].name, name) == 0 );
if( i != *icptr )
- return -4;/* already got this instance */
+ return -4; /* already got this instance */
}
ARR_FIND(0, instance->instances, i, instance->list[i].state == INSTANCE_FREE);