summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-02-05 14:11:43 +0000
committerultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-02-05 14:11:43 +0000
commitc4c3107d53002da172af6d93e21a8741d9b0b266 (patch)
treec2cd8ea26452fc322adb4e4553685a6f7c88217f
parent4a7dd96086cc2ece33d876671db5b0cb8d82b1ac (diff)
downloadhercules-c4c3107d53002da172af6d93e21a8741d9b0b266.tar.gz
hercules-c4c3107d53002da172af6d93e21a8741d9b0b266.tar.bz2
hercules-c4c3107d53002da172af6d93e21a8741d9b0b266.tar.xz
hercules-c4c3107d53002da172af6d93e21a8741d9b0b266.zip
Changed the 'getpartyleader' script command so that it returns a map name instead of the useless mapindex number.
Also fixed it so that it doesn't throw a 'args of aFree is not valid pointer' error (although I'm not at all sure that the fix is correct). git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9787 54d463be-8e91-2dee-dedb-b68131a5f0ec
-rw-r--r--Changelog-Trunk.txt5
-rw-r--r--doc/script_commands.txt14
-rw-r--r--src/map/script.c6
3 files changed, 16 insertions, 9 deletions
diff --git a/Changelog-Trunk.txt b/Changelog-Trunk.txt
index 9e3d2a1b6..b8c76047b 100644
--- a/Changelog-Trunk.txt
+++ b/Changelog-Trunk.txt
@@ -4,6 +4,11 @@ AS OF SVN REV. 5091, WE ARE NOW USING TRUNK. ALL UNTESTED BUGFIXES/FEATURES GO
IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK.
2007/02/05
+ * Changed the 'getpartyleader' script command so that it returns a map
+ name instead of the useless mapindex number. Also fixed it so that it
+ doesn't throw a 'args of aFree is not valid pointer' error.
+ (although I'm not at all sure that the fix is correct)
+ Ref: http://www.eathena.ws/board/index.php?showtopic=137274
* Removed the silly and misleading 'firewall detected' message
2007/02/03
* Added missing vc6 project file
diff --git a/doc/script_commands.txt b/doc/script_commands.txt
index 65d61f4ba..212ad25d6 100644
--- a/doc/script_commands.txt
+++ b/doc/script_commands.txt
@@ -2155,18 +2155,19 @@ Example:
*getpartyleader <party id>,[<type>];
-This function returns some information about the given party-id's leader. When type is ommitted,
-the default information retrieved is Character name of the party leader. Possible types are:
+This function returns some information about the given party-id's leader.
+When type is ommitted, the default information retrieved is the leader's name.
+Possible types are:
1: Leader account id
2: Leader character id
3: Leader's class
- 4: Leader's current map index
+ 4: Leader's current map name
5: Leader's current level as stored on the party structure (may not be
current level if leader leveled up recently).
-If retrieval fails (leader not found or party does not exists), "null" is returned instead of character name,
-and -1 is returned for the other types.
+If retrieval fails (leader not found or party does not exist), this function
+returns "null" instead of the character name, and -1 is for the other types.
---------------------------------------
*getguildname(<guild id>)
@@ -3548,7 +3549,8 @@ four values:
- val3 is the second element, val4 is the resistance to said element.
eg: sc_start4 SC_DefEle,60000,Ele_Fire,20,Ele_Water,-15;
-'sc_end' will remove a specified status effect.
+'sc_end' will remove a specified status effect. If SC_All is used (-1), it will
+do a complete removal of all statuses (although permanent ones will re-apply).
You can see the full list of status effects caused by skills in
'src/map/status.h' - they are currently not fully documented, but most of that
diff --git a/src/map/script.c b/src/map/script.c
index 3cce74af1..a8b68db03 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -3877,7 +3877,7 @@ struct script_function buildin_func[] = {
{buildin_getcharid,"getcharid","i*"},
{buildin_getpartyname,"getpartyname","i"},
{buildin_getpartymember,"getpartymember","i*"},
- {buildin_getpartyleader,"getpartyleader","i*"},
+ {buildin_getpartyleader,"getpartyleader","i?"},
{buildin_getguildname,"getguildname","i"},
{buildin_getguildmaster,"getguildmaster","i"},
{buildin_getguildmasterid,"getguildmasterid","i"},
@@ -6006,13 +6006,13 @@ int buildin_getpartyleader(struct script_state *st)
push_val(st->stack,C_INT,p->party.member[i].class_);
break;
case 4:
- push_val(st->stack,C_INT,p->party.member[i].map);
+ push_str(st->stack,C_CONSTSTR,(char*)mapindex_id2name(p->party.member[i].map));
break;
case 5:
push_val(st->stack,C_INT,p->party.member[i].lv);
break;
default:
- push_str(st->stack,C_STR,p->party.member[i].name);
+ push_str(st->stack,C_CONSTSTR,p->party.member[i].name);
break;
}
return 0;