diff options
author | ai4rei <ai4rei@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2011-05-15 05:30:25 +0000 |
---|---|---|
committer | ai4rei <ai4rei@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2011-05-15 05:30:25 +0000 |
commit | a7c1a55bb6f3c3236ba02722e948a52c645a4918 (patch) | |
tree | 15c41cc68bb37051f7fb94bac03055875e25fe5d /src/map/instance.c | |
parent | ec4acd7b1d7f180af5929239ef0706d98d4b6bfc (diff) | |
download | hercules-a7c1a55bb6f3c3236ba02722e948a52c645a4918.tar.gz hercules-a7c1a55bb6f3c3236ba02722e948a52c645a4918.tar.bz2 hercules-a7c1a55bb6f3c3236ba02722e948a52c645a4918.tar.xz hercules-a7c1a55bb6f3c3236ba02722e948a52c645a4918.zip |
* Merged changes from trunk [14784:14819/trunk].
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/branches/renewal@14821 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/instance.c')
-rw-r--r-- | src/map/instance.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/map/instance.c b/src/map/instance.c index 6fa3a2c0a..e9ff2b409 100644 --- a/src/map/instance.c +++ b/src/map/instance.c @@ -31,22 +31,21 @@ struct s_instance instance[MAX_INSTANCE]; /*-------------------------------------- * name : instance name * Return value could be - * -4 = already exists | -3 = no free instances | -2 = missing parameter | -1 = invalid type + * -4 = already exists | -3 = no free instances | -2 = party not found | -1 = invalid type * On success return instance_id *--------------------------------------*/ int instance_create(int party_id, const char *name) { int i; - struct party_data *p = NULL; + struct party_data* p; - if( !party_id || !name ) + if( ( p = party_search(party_id) ) == NULL ) { - ShowError("map_instance_create: missing parameter.\n"); + ShowError("instance_create: party %d not found for instance '%s'.\n", party_id, name); return -2; } - p = party_search(party_id); - if( !p || p->instance_id ) + if( p->instance_id ) return -4; // Party already instancing // Searching a Free Instance @@ -54,7 +53,7 @@ int instance_create(int party_id, const char *name) ARR_FIND(1, MAX_INSTANCE, i, instance[i].state == INSTANCE_FREE); if( i == MAX_INSTANCE ) { - ShowError("map_instance_create: no free instances, consider increasing MAX_INSTANCE.\n"); + ShowError("instance_create: no free instances, consider increasing MAX_INSTANCE.\n"); return -3; } |