summaryrefslogtreecommitdiff
path: root/src/map/instance.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/map/instance.c')
-rw-r--r--src/map/instance.c13
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;
}