summaryrefslogtreecommitdiff
path: root/src/char/int_guild.c
diff options
context:
space:
mode:
authorcodemaster <codemaster@54d463be-8e91-2dee-dedb-b68131a5f0ec>2004-11-24 22:23:56 +0000
committercodemaster <codemaster@54d463be-8e91-2dee-dedb-b68131a5f0ec>2004-11-24 22:23:56 +0000
commitf622539b5865e948eff27f7dd5bc84dbe1d088d6 (patch)
treef08b2b5379679c82cde622d20bbd61b00a892c93 /src/char/int_guild.c
parent7f7c0c4e31a17c9ae854f9460ccd34b4b5698f90 (diff)
downloadhercules-f622539b5865e948eff27f7dd5bc84dbe1d088d6.tar.gz
hercules-f622539b5865e948eff27f7dd5bc84dbe1d088d6.tar.bz2
hercules-f622539b5865e948eff27f7dd5bc84dbe1d088d6.tar.xz
hercules-f622539b5865e948eff27f7dd5bc84dbe1d088d6.zip
- Updated to most of jA's 1067
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/athena@352 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/char/int_guild.c')
-rw-r--r--src/char/int_guild.c21
1 files changed, 14 insertions, 7 deletions
diff --git a/src/char/int_guild.c b/src/char/int_guild.c
index 586b42f55..eb03dd335 100644
--- a/src/char/int_guild.c
+++ b/src/char/int_guild.c
@@ -619,8 +619,15 @@ 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;
}
// ギルドの情報の再計算
@@ -630,7 +637,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)
@@ -649,7 +656,7 @@ int guild_calcinfo(struct guild *g) {
g->next_exp = guild_nextexp(g->guild_lv);
// メンバ上限(ギルド拡張適用)
- g->max_member = 16 + guild_checkskill(g, 10004) * 2;
+ g->max_member = 16 + guild_checkskill(g, GD_EXTENSION) * 2;
// 平均レベルとオンライン人数
g->average_lv = 0;
@@ -980,7 +987,7 @@ int mapif_parse_CreateGuild(int fd, int account_id, char *name, struct guild_mem
g->max_member = 16;
g->average_lv = master->lv;
for(i = 0; i < MAX_GUILDSKILL; i++)
- g->skill[i].id = i + 10000;
+ g->skill[i].id=i + GD_SKILLBASE;
numdb_insert(guild_db, g->guild_id, g);
@@ -1230,9 +1237,9 @@ int mapif_parse_GuildPosition(int fd, int guild_id, int idx, struct guild_positi
// ギルドスキルアップ要求
int mapif_parse_GuildSkillUp(int fd, int guild_id, int skill_num, int account_id) {
struct guild *g = numdb_search(guild_db, guild_id);
- int idx = skill_num - 10000;
+ int idx = skill_num - GD_SKILLBASE;
- if (g == NULL || skill_num < 10000)
+ if (g == NULL || idx < 0 || idx >= MAX_GUILDSKILL)
return 0;
if (g->skill_point > 0 && g->skill[idx].id > 0 && g->skill[idx].lv < 10) {