diff options
author | Haruna <haru@dotalux.com> | 2015-10-24 15:47:41 +0200 |
---|---|---|
committer | Haruna <haru@dotalux.com> | 2015-10-24 15:47:41 +0200 |
commit | 06d79297d782bb14f16aacdbfbef230e81219fae (patch) | |
tree | 2bb823b18a0334c544524410a3868c551068d6be | |
parent | b286ad29f7542d0630776a377974bf2997e1e749 (diff) | |
parent | 7b8923a6bc228fee37189a6ce99934ad2976807d (diff) | |
download | hercules-06d79297d782bb14f16aacdbfbef230e81219fae.tar.gz hercules-06d79297d782bb14f16aacdbfbef230e81219fae.tar.bz2 hercules-06d79297d782bb14f16aacdbfbef230e81219fae.tar.xz hercules-06d79297d782bb14f16aacdbfbef230e81219fae.zip |
Merge pull request #813 from 4144/instancefix
Fix crash in instance.c
-rw-r--r-- | src/map/instance.c | 4 |
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); |