diff options
author | ai4rei <ai4rei@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2011-10-28 12:33:30 +0000 |
---|---|---|
committer | ai4rei <ai4rei@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2011-10-28 12:33:30 +0000 |
commit | 5b3532830e8c18baea99eccaa21a5c7569f8d02d (patch) | |
tree | fdbee1bf48e372a16ae833c8996aad27c3e808d0 /src/map/guild.c | |
parent | fb33ba865eb09eef71ed38adbd141b6d771321b8 (diff) | |
download | hercules-5b3532830e8c18baea99eccaa21a5c7569f8d02d.tar.gz hercules-5b3532830e8c18baea99eccaa21a5c7569f8d02d.tar.bz2 hercules-5b3532830e8c18baea99eccaa21a5c7569f8d02d.tar.xz hercules-5b3532830e8c18baea99eccaa21a5c7569f8d02d.zip |
* Fixed db/packet_db.txt reading not checking for max. amount of positions.
* Introduced MAX_GUILD_SKILL_REQUIRE to fix inconsistency in amount of prereq. guild skills.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14985 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/guild.c')
-rw-r--r-- | src/map/guild.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/map/guild.c b/src/map/guild.c index 0b77aa9a1..835f10f9e 100644 --- a/src/map/guild.c +++ b/src/map/guild.c @@ -52,13 +52,14 @@ struct guild_expcache { }; static struct eri *expcache_ers; //For handling of guild exp payment. +#define MAX_GUILD_SKILL_REQUIRE 5 struct{ int id; int max; struct{ short id; short lv; - }need[6]; + }need[MAX_GUILD_SKILL_REQUIRE]; } guild_skill_tree[MAX_GUILDSKILL]; int guild_payexp_timer(int tid, unsigned int tick, int id, intptr_t data); @@ -124,7 +125,7 @@ static bool guild_read_guildskill_tree_db(char* split[], int columns, int curren guild_skill_tree[id].max = 1; } - for( k = 0; k < 5; k++ ) + for( k = 0; k < MAX_GUILD_SKILL_REQUIRE; k++ ) { guild_skill_tree[id].need[k].id = atoi(split[k*2+2]); guild_skill_tree[id].need[k].lv = atoi(split[k*2+3]); @@ -147,7 +148,7 @@ int guild_check_skill_require(struct guild *g,int id) if (idx < 0 || idx >= MAX_GUILDSKILL) return 0; - for(i=0;i<5;i++) + for(i=0;i<MAX_GUILD_SKILL_REQUIRE;i++) { if(guild_skill_tree[idx].need[i].id == 0) break; if(guild_skill_tree[idx].need[i].lv > guild_checkskill(g,guild_skill_tree[idx].need[i].id)) @@ -1943,7 +1944,7 @@ void do_init_guild(void) sv_readdb(db_path, "castle_db.txt", ',', 4, 5, -1, &guild_read_castledb); memset(guild_skill_tree,0,sizeof(guild_skill_tree)); - sv_readdb(db_path, "guild_skill_tree.txt", ',', 12, 12, -1, &guild_read_guildskill_tree_db); //guild skill tree [Komurka] + sv_readdb(db_path, "guild_skill_tree.txt", ',', 2+MAX_GUILD_SKILL_REQUIRE*2, 2+MAX_GUILD_SKILL_REQUIRE*2, -1, &guild_read_guildskill_tree_db); //guild skill tree [Komurka] add_timer_func_list(guild_payexp_timer,"guild_payexp_timer"); add_timer_func_list(guild_send_xy_timer, "guild_send_xy_timer"); |