diff options
author | ultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2007-11-09 22:42:56 +0000 |
---|---|---|
committer | ultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2007-11-09 22:42:56 +0000 |
commit | f3753f1cd474a84748b88991f74bcaa4f590f4ff (patch) | |
tree | 4e0f2fae76761e1b7e267f81f946f68da28b1f2a /src/map/skill.c | |
parent | b397f7c6615f68f044100168eeaf157f6c60227c (diff) | |
download | hercules-f3753f1cd474a84748b88991f74bcaa4f590f4ff.tar.gz hercules-f3753f1cd474a84748b88991f74bcaa4f590f4ff.tar.bz2 hercules-f3753f1cd474a84748b88991f74bcaa4f590f4ff.tar.xz hercules-f3753f1cd474a84748b88991f74bcaa4f590f4ff.zip |
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
Diffstat (limited to 'src/map/skill.c')
-rw-r--r-- | src/map/skill.c | 18 |
1 files changed, 7 insertions, 11 deletions
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) |