From f3753f1cd474a84748b88991f74bcaa4f590f4ff Mon Sep 17 00:00:00 2001 From: ultramage Date: Fri, 9 Nov 2007 22:42:56 +0000 Subject: Replaced several 'int' variables with enums that they represent. Expanded weapon_type enum with dual-wield constants (bugreport:384). git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11704 54d463be-8e91-2dee-dedb-b68131a5f0ec --- src/map/skill.c | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) (limited to 'src/map/skill.c') diff --git a/src/map/skill.c b/src/map/skill.c index 15c49c915..943548c91 100644 --- a/src/map/skill.c +++ b/src/map/skill.c @@ -1890,15 +1890,11 @@ static int skill_check_condition_hom (struct homun_data *hd, int skill, int lv, if (!sc->count) sc = NULL; - // for the guild skills [celest] - if (skill >= HM_SKILLBASE) //[orn] - j = HM_SKILLRANGEMIN + skill - HM_SKILLBASE; - else - j = skill; - if (j < 0 || j >= MAX_SKILL_DB) - return 0; //Code speedup, rather than using skill_get_* over and over again. - if (lv < 1 || lv > MAX_SKILL_LEVEL) + j = skill_get_index(skill); + if( j == 0 ) + return 0; + if( lv < 1 || lv > MAX_SKILL_LEVEL ) return 0; for(i = 0; i < 10; i++) { @@ -7510,13 +7506,13 @@ int skill_check_condition(struct map_session_data* sd, short skill, short lv, in return 1; } + //Code speedup, rather than using skill_get_* over and over again. j = skill_get_index(skill); - if (j == 0) // invalid skill id + if( j == 0 ) // invalid skill id return 0; - if (lv < 1 || lv > MAX_SKILL_LEVEL) + if( lv < 1 || lv > MAX_SKILL_LEVEL ) return 0; - //Code speedup, rather than using skill_get_* over and over again. hp = skill_db[j].hp[lv-1]; sp = skill_db[j].sp[lv-1]; if((sd->skillid_old == BD_ENCORE) && skill == sd->skillid_dance) -- cgit v1.2.3-70-g09d2