diff options
author | ultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2008-04-08 15:54:52 +0000 |
---|---|---|
committer | ultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2008-04-08 15:54:52 +0000 |
commit | 7410adee2a636b1fab6adcd5a581048146d2a9a5 (patch) | |
tree | 07b55588a54f6e684ff187fbf2e9641ba032d9ca /src/map/guild.c | |
parent | 87ac3c6f8367ba972124231ff1306ed890abc6b8 (diff) | |
download | hercules-7410adee2a636b1fab6adcd5a581048146d2a9a5.tar.gz hercules-7410adee2a636b1fab6adcd5a581048146d2a9a5.tar.bz2 hercules-7410adee2a636b1fab6adcd5a581048146d2a9a5.tar.xz hercules-7410adee2a636b1fab6adcd5a581048146d2a9a5.zip |
Small party/guild creation cleanup. Added packet comments. Removed fake reply packet usage.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@12538 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/guild.c')
-rw-r--r-- | src/map/guild.c | 29 |
1 files changed, 16 insertions, 13 deletions
diff --git a/src/map/guild.c b/src/map/guild.c index aa91ee3ac..f008f7abf 100644 --- a/src/map/guild.c +++ b/src/map/guild.c @@ -397,28 +397,31 @@ int guild_send_dot_remove(struct map_session_data *sd) } //------------------------------------------------------------------------ -// 作成要求 -int guild_create(struct map_session_data *sd,char *name) +int guild_create(struct map_session_data *sd, const char *name) { char tname[NAME_LENGTH]; + struct guild_member m; nullpo_retr(0, sd); safestrncpy(tname, name, NAME_LENGTH); + if( strlen(trim(tname)) == 0 ) + return 0; // empty name - if(sd->status.guild_id || strlen(trim(tname)) == 0) - { - clif_guild_created(sd,1); // すでに所属している + if( sd->status.guild_id ) + {// already in a guild + clif_guild_created(sd,1); return 0; } - if(!battle_config.guild_emperium_check || pc_search_inventory(sd,714) >= 0) { - struct guild_member m; - guild_makemember(&m,sd); - m.position=0; - intif_guild_create(name,&m); - return 1; + if( battle_config.guild_emperium_check && pc_search_inventory(sd,714) == -1 ) + {// item required + clif_guild_created(sd,3); + return 0; } - clif_guild_created(sd,3); // エンペリウムがいない - return 0; + + guild_makemember(&m,sd); + m.position=0; + intif_guild_create(name,&m); + return 1; } // 作成可否 |