summaryrefslogtreecommitdiff
path: root/src/map/instance.c
diff options
context:
space:
mode:
authorai4rei <ai4rei@54d463be-8e91-2dee-dedb-b68131a5f0ec>2011-05-08 05:34:35 +0000
committerai4rei <ai4rei@54d463be-8e91-2dee-dedb-b68131a5f0ec>2011-05-08 05:34:35 +0000
commit0f130e615463dfa6150d097c72a4612868e180f5 (patch)
tree1af4bfc2105efa6dac73cc112155aaf5f9a65f8f /src/map/instance.c
parent77d43dcefbbfbcbaf2b1cd1f5da2017673c1b5dc (diff)
downloadhercules-0f130e615463dfa6150d097c72a4612868e180f5.tar.gz
hercules-0f130e615463dfa6150d097c72a4612868e180f5.tar.bz2
hercules-0f130e615463dfa6150d097c72a4612868e180f5.tar.xz
hercules-0f130e615463dfa6150d097c72a4612868e180f5.zip
* Updated/revised description of instance-related script commands (bugreport:4880).
- Fixed 'instance_create' would return -4 (party already instancing) when the requested party was not found. - 'instance_create' return value -2 now means 'party not found' rather than 'missing parameter'. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14809 54d463be-8e91-2dee-dedb-b68131a5f0ec
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;
}