summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorcodemaster <codemaster@54d463be-8e91-2dee-dedb-b68131a5f0ec>2004-11-24 22:23:26 +0000
committercodemaster <codemaster@54d463be-8e91-2dee-dedb-b68131a5f0ec>2004-11-24 22:23:26 +0000
commit2147c872e095f32b81433fbdd54a98763180d5ee (patch)
treec9a1d4b5b90863c02028cf69245b71bc707e0f4c /src
parent2922c80db2d0235846aa05c450b68e01401131c0 (diff)
downloadhercules-2147c872e095f32b81433fbdd54a98763180d5ee.tar.gz
hercules-2147c872e095f32b81433fbdd54a98763180d5ee.tar.bz2
hercules-2147c872e095f32b81433fbdd54a98763180d5ee.tar.xz
hercules-2147c872e095f32b81433fbdd54a98763180d5ee.zip
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/athena@350 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src')
-rw-r--r--src/char_sql/int_guild.c23
1 files changed, 17 insertions, 6 deletions
diff --git a/src/char_sql/int_guild.c b/src/char_sql/int_guild.c
index 8c6a4cea6..4f6c88a70 100644
--- a/src/char_sql/int_guild.c
+++ b/src/char_sql/int_guild.c
@@ -681,7 +681,18 @@ int guild_nextexp(int level)
}
// ギルドスキルがあるか確認
-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_calcinfo(struct guild *g)
@@ -691,7 +702,7 @@ int guild_calcinfo(struct guild *g)
// スキルIDの設定
for(i=0;i<MAX_GUILDSKILL;i++)
- g->skill[i].id=i+10000;
+ g->skill[i].id=i+GD_SKILLBASE;
// ギルドレベル
if(g->guild_lv<=0) g->guild_lv=1;
@@ -709,7 +720,7 @@ int guild_calcinfo(struct guild *g)
g->next_exp = guild_nextexp(g->guild_lv);
// メンバ上限(ギルド拡張適用)
- g->max_member=16+guild_checkskill(g,10004)*2; // Updated max_members [PoW]
+ g->max_member = 16 + guild_checkskill(g, GD_EXTENSION) * 2; // Updated max_members [PoW]
// 平均レベルとオンライン人数
g->average_lv=0;
@@ -1047,7 +1058,7 @@ int mapif_parse_CreateGuild(int fd,int account_id,char *name,struct guild_member
g->average_lv=master->lv;
g->castle_id=-1;
for(i=0;i<MAX_GUILDSKILL;i++)
- g->skill[i].id=i+10000;
+ g->skill[i].id=i + GD_SKILLBASE;
// Save to sql
printf("Create initialize OK!\n");
@@ -1381,11 +1392,11 @@ int mapif_parse_GuildSkillUp(int fd,int guild_id,int skill_num,int account_id)
{
// Could make some improvement in speed, because only change guild_position
struct guild *g=guild_pt;
- int idx=skill_num-10000;
+ int idx = skill_num - GD_SKILLBASE;
inter_guild_fromsql(guild_id,g);
- if(g==NULL || skill_num<10000)
+ if(g == NULL || idx < 0 || idx >= MAX_GUILDSKILL)
return 0;
//printf("GuildSkillUp\n");