diff options
author | Inkfish <Inkfish@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2009-10-11 03:07:52 +0000 |
---|---|---|
committer | Inkfish <Inkfish@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2009-10-11 03:07:52 +0000 |
commit | 72351d986315e826c7c32d0de62932067fd98bb8 (patch) | |
tree | 9946c59f6e4b3a9b0747adc3be3828b1ab261aae /src/char_sql/int_guild.c | |
parent | 452a0b793b0cdc3b16cfc0738926ade4322bda53 (diff) | |
download | hercules-72351d986315e826c7c32d0de62932067fd98bb8.tar.gz hercules-72351d986315e826c7c32d0de62932067fd98bb8.tar.bz2 hercules-72351d986315e826c7c32d0de62932067fd98bb8.tar.xz hercules-72351d986315e826c7c32d0de62932067fd98bb8.zip |
Added character rename function.(topic:225576)(written by pakpil and fixed by me)
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14084 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/char_sql/int_guild.c')
-rw-r--r-- | src/char_sql/int_guild.c | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/src/char_sql/int_guild.c b/src/char_sql/int_guild.c index 725a5059f..24b0cea7b 100644 --- a/src/char_sql/int_guild.c +++ b/src/char_sql/int_guild.c @@ -1673,6 +1673,42 @@ int inter_guild_sex_changed(int guild_id,int account_id,int char_id, int gender) return mapif_parse_GuildMemberInfoChange(0, guild_id, account_id, char_id, GMI_GENDER, (const char*)&gender, sizeof(gender)); } +int inter_guild_charname_changed(int guild_id,int account_id, int char_id, char *name) +{ + struct guild *g; + int i, flag = 0; + + g = inter_guild_fromsql(guild_id); + if( g == NULL ) + { + ShowError("inter_guild_charrenamed: Can't find guild %d.\n", guild_id); + return 0; + } + + ARR_FIND(0, g->max_member, i, g->member[i].char_id == char_id); + if( i == g->max_member ) + { + ShowError("inter_guild_charrenamed: Can't find character %d in the guild\n", char_id); + return 0; + } + + if( !strcmp(g->member[i].name, g->master) ) + { + safestrncpy(g->master, name, NAME_LENGTH); + flag |= GS_BASIC; + } + safestrncpy(g->member[i].name, name, NAME_LENGTH); + g->member[i].modified = GS_MEMBER_MODIFIED; + flag |= GS_MEMBER; + + if( !inter_guild_tosql(g, flag) ) + return 0; + + mapif_guild_info(-1,g); + + return 0; +} + // Change a position desc int mapif_parse_GuildPosition(int fd,int guild_id,int idx,struct guild_position *p) { |