summaryrefslogtreecommitdiff
path: root/src/map/atcommand.c
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2009-11-19 18:19:09 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2009-11-19 18:19:09 +0000
commit30c8d7704026aa450b64997c2996ee8d9d4f2cec (patch)
treedae267b2e016111da192de4dbf67679878e73409 /src/map/atcommand.c
parent620ea0643c3bcbfed5dd7c84e8d65fc8941997a7 (diff)
downloadhercules-30c8d7704026aa450b64997c2996ee8d9d4f2cec.tar.gz
hercules-30c8d7704026aa450b64997c2996ee8d9d4f2cec.tar.bz2
hercules-30c8d7704026aa450b64997c2996ee8d9d4f2cec.tar.xz
hercules-30c8d7704026aa450b64997c2996ee8d9d4f2cec.zip
- Applied the renewal client support patch from Diablo (eA forum topic 222623)
- Added support for strcharinfo(3) to retrieve the player's map - Added script command "searchitem" for name item searches. - Moved PACKETVER to src/common/mmo.h as it's needed by the char-server now - Changed the status valX from int to long so that it won't break for pointer-storage in other architectures. - Moved the change party leader code to party.c - A few bugfixes or packet field completions based on my past experience messing around with my server. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14155 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/atcommand.c')
-rw-r--r--src/map/atcommand.c54
1 files changed, 4 insertions, 50 deletions
diff --git a/src/map/atcommand.c b/src/map/atcommand.c
index fe86cced7..bb8c1d683 100644
--- a/src/map/atcommand.c
+++ b/src/map/atcommand.c
@@ -2725,8 +2725,7 @@ int atcommand_produce(const int fd, struct map_session_data* sd, const char* com
if ((item_data = itemdb_searchname(item_name)) == NULL &&
(item_data = itemdb_exists(atoi(item_name))) == NULL)
{
- strcpy(atcmd_output, msg_txt(170)); // The item is not equipable.
- clif_displaymessage(fd, atcmd_output);
+ clif_displaymessage(fd, msg_txt(170)); //This item is not an equipment.
return -1;
}
item_id = item_data->nameid;
@@ -5950,62 +5949,17 @@ int atcommand_changegm(const int fd, struct map_session_data* sd, const char* co
*------------------------------------------*/
int atcommand_changeleader(const int fd, struct map_session_data* sd, const char* command, const char* message)
{
- struct party_data *p;
- struct map_session_data *pl_sd;
- int mi, pl_mi;
nullpo_retr(-1, sd);
-
- if (sd->status.party_id == 0 || (p = party_search(sd->status.party_id)) == NULL)
- { //Need to be a party leader.
- clif_displaymessage(fd, msg_txt(282));
- return -1;
- }
-
- if( map[sd->bl.m].flag.partylock )
- {
- clif_displaymessage(fd, "You cannot change party leaders on this map.");
- return -1;
- }
-
- ARR_FIND( 0, MAX_PARTY, mi, p->data[mi].sd == sd );
- if (mi == MAX_PARTY)
- return -1; //Shouldn't happen
-
- if (!p->party.member[mi].leader)
- { //Need to be a party leader.
- clif_displaymessage(fd, msg_txt(282));
- return -1;
- }
if (strlen(message)==0)
{
clif_displaymessage(fd, "Command usage: @changeleader <party member name>");
return -1;
}
-
- if((pl_sd=map_nick2sd((char *) message)) == NULL || pl_sd->status.party_id != sd->status.party_id) {
- clif_displaymessage(fd, msg_txt(283));
- return -1;
- }
- for (pl_mi = 0; pl_mi < MAX_PARTY && p->data[pl_mi].sd != pl_sd; pl_mi++);
-
- if (pl_mi == MAX_PARTY)
- return -1; //Shouldn't happen
-
- //Change leadership.
- p->party.member[mi].leader = 0;
- if (p->data[mi].sd->fd)
- clif_displaymessage(p->data[mi].sd->fd, msg_txt(284));
- p->party.member[pl_mi].leader = 1;
- if (p->data[pl_mi].sd->fd)
- clif_displaymessage(p->data[pl_mi].sd->fd, msg_txt(285));
-
- intif_party_leaderchange(p->party.party_id,p->party.member[pl_mi].account_id,p->party.member[pl_mi].char_id);
- //Update info.
- clif_party_info(p,NULL);
-
- return 0;
+ if (party_changeleader(sd, map_nick2sd((char *) message)))
+ return 0;
+ return -1;
}
/*==========================================