From 42e1df9e61f8efb6340ed1c9238cd247d553d9b8 Mon Sep 17 00:00:00 2001 From: Haru Date: Thu, 23 Jan 2014 18:40:29 +0100 Subject: Replaced some of the hardcoded values with constants (char) - Replaced several hardcoded values with the appropriate enums. - Added documentation for some hardcoded values that haven't been replaced by enums (yet) - Minor code legibility improvements. Signed-off-by: Haru --- src/map/guild.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'src/map/guild.c') diff --git a/src/map/guild.c b/src/map/guild.c index 936b4c900..c776cf2fc 100644 --- a/src/map/guild.c +++ b/src/map/guild.c @@ -615,7 +615,7 @@ int guild_invite(struct map_session_data *sd, struct map_session_data *tsd) { if(tsd==NULL || g==NULL) return 0; - if( (i=guild->getposition(g,sd))<0 || !(g->position[i].mode&0x0001) ) + if( (i=guild->getposition(g,sd)) < 0 || !(g->position[i].mode&GPERM_INVITE) ) return 0; //Invite permission. if(!battle_config.invite_request_check) { @@ -840,7 +840,7 @@ int guild_expulsion(struct map_session_data* sd, int guild_id, int account_id, i if(sd->status.guild_id!=guild_id) return 0; - if( (ps=guild->getposition(g,sd))<0 || !(g->position[ps].mode&0x0010) ) + if ((ps=guild->getposition(g,sd))<0 || !(g->position[ps].mode&GPERM_EXPEL)) return 0; //Expulsion permission //Can't leave inside guild castles. @@ -1095,9 +1095,7 @@ int guild_change_position(int guild_id,int idx,int mode,int exp_mode,const char struct guild_position p; exp_mode = cap_value(exp_mode, 0, battle_config.guild_exp_limit); - //Mode 0x01 <- Invite - //Mode 0x10 <- Expel. - p.mode=mode&0x11; + p.mode=mode&GPERM_BOTH; // Invite and Expel p.exp_mode=exp_mode; safestrncpy(p.name,name,NAME_LENGTH); return intif->guild_position(guild_id,idx,&p); -- cgit v1.2.3-70-g09d2