summaryrefslogtreecommitdiff
path: root/src/map/guild.c
diff options
context:
space:
mode:
authorcodemaster <codemaster@54d463be-8e91-2dee-dedb-b68131a5f0ec>2004-11-24 22:27:20 +0000
committercodemaster <codemaster@54d463be-8e91-2dee-dedb-b68131a5f0ec>2004-11-24 22:27:20 +0000
commita093dbfa6658df2636c83afb833508cc08ecb018 (patch)
treea9a614c1fed79ba3e743eddfae2c630137c5fe9c /src/map/guild.c
parent4037e93e4fc65c1be4beb632074beeadd413ffc3 (diff)
downloadhercules-a093dbfa6658df2636c83afb833508cc08ecb018.tar.gz
hercules-a093dbfa6658df2636c83afb833508cc08ecb018.tar.bz2
hercules-a093dbfa6658df2636c83afb833508cc08ecb018.tar.xz
hercules-a093dbfa6658df2636c83afb833508cc08ecb018.zip
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/athena@354 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/guild.c')
-rw-r--r--src/map/guild.c27
1 files changed, 21 insertions, 6 deletions
diff --git a/src/map/guild.c b/src/map/guild.c
index 411289aa7..ca3bbf1fe 100644
--- a/src/map/guild.c
+++ b/src/map/guild.c
@@ -54,13 +54,25 @@ int guild_skill_get_inf(int id) { // Modified for new skills [Sara]
int guild_skill_get_sp(int id,int lv){ return 0; }
int guild_skill_get_range(int id){ return 0; }
int guild_skill_get_max(int id) { // Modified for new skills [Sara]
- if (id==GD_EXTENSION) return 10;
- else if (id==GD_REGENERATION) return 3;
+ if(id==GD_EXTENSION) return 10;
+ else if(id==GD_REGENERATION) return 3;
else return 1;
}
// ギルドスキルがあるか確認
-int guild_checkskill(struct guild *g,int id){ return g->skill[id-10000].lv; }
+int guild_checkskill(struct guild *g,int id)
+{
+
+ int idx = id-GD_SKILLBASE;
+
+
+ if (idx < 0 || idx >= MAX_GUILDSKILL)
+
+ return 0;
+
+ return g->skill[idx].lv;
+
+}
int guild_payexp_timer(int tid,unsigned int tick,int id,int data);
@@ -931,17 +943,20 @@ int guild_payexp(struct map_session_data *sd,int exp)
int guild_skillup(struct map_session_data *sd,int skill_num,int flag)
{
struct guild *g;
- int idx;
+ int idx = skill_num - GD_SKILLBASE;
nullpo_retr(0, sd);
+ if(idx < 0 || idx >= MAX_GUILDSKILL)
+
+ return 0;
if(sd->status.guild_id==0 || (g=guild_search(sd->status.guild_id))==NULL)
return 0;
if(strcmp(sd->status.name,g->master))
return 0;
if( (g->skill_point>0 || flag&1) &&
- g->skill[(idx=skill_num-10000)].id!=0 &&
+ g->skill[idx].id!=0 &&
g->skill[idx].lv < guild_skill_get_max(skill_num) ){
intif_guild_skillup(g->guild_id,skill_num,sd->status.account_id,flag);
}
@@ -958,7 +973,7 @@ int guild_skillupack(int guild_id,int skill_num,int account_id)
if(g==NULL)
return 0;
if(sd!=NULL)
- clif_guild_skillup(sd,skill_num,g->skill[skill_num-10000].lv);
+ clif_guild_skillup(sd,skill_num,g->skill[skill_num-GD_SKILLBASE].lv);
// 全員に通知
for(i=0;i<g->max_member;i++)
if((sd=g->member[i].sd)!=NULL)