diff options
author | markzd <markzd@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2013-01-05 04:45:53 +0000 |
---|---|---|
committer | markzd <markzd@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2013-01-05 04:45:53 +0000 |
commit | 59029a6c7a0365521aa80519081fdfc7d958cca0 (patch) | |
tree | e096f8d20d0bbb2bcae2fa93de15d5cf4da8196a /src/map/skill.c | |
parent | 39b04a578b2a74f9e48b0eb2583c249f98c9404d (diff) | |
download | hercules-59029a6c7a0365521aa80519081fdfc7d958cca0.tar.gz hercules-59029a6c7a0365521aa80519081fdfc7d958cca0.tar.bz2 hercules-59029a6c7a0365521aa80519081fdfc7d958cca0.tar.xz hercules-59029a6c7a0365521aa80519081fdfc7d958cca0.zip |
* Follow up r17065
1. Removed some unnecessary checks.(bugreport:7078)
2. Fixed some index's which would access an invalid array position, crashing the server.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@17077 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/skill.c')
-rw-r--r-- | src/map/skill.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/map/skill.c b/src/map/skill.c index 8241aa55f..13e92943e 100644 --- a/src/map/skill.c +++ b/src/map/skill.c @@ -724,7 +724,7 @@ int skill_additional_effect (struct block_list* src, struct block_list *bl, uint nullpo_ret(src); nullpo_ret(bl); - if(skill_id > 0 && skill_lv <= 0) return 0; // don't forget auto attacks! - celest + if(skill_id > 0 && !skill_lv) return 0; // don't forget auto attacks! - celest if( dmg_lv < ATK_BLOCK ) // Don't apply effect if miss. return 0; @@ -1745,7 +1745,7 @@ int skill_counter_additional_effect (struct block_list* src, struct block_list * nullpo_ret(src); nullpo_ret(bl); - if(skill_id > 0 && skill_lv <= 0) return 0; // don't forget auto attacks! - celest + if(skill_id > 0 && !skill_lv) return 0; // don't forget auto attacks! - celest sd = BL_CAST(BL_PC, src); dstsd = BL_CAST(BL_PC, bl); @@ -2232,8 +2232,8 @@ int skill_attack (int attack_type, struct block_list* src, struct block_list *ds if (pd->a_skill && pd->a_skill->div_ && pd->a_skill->id == skill_id) { int element = skill_get_ele(skill_id, skill_lv); - if (skill_id == -1) - element = sstatus->rhw.ele; + /*if (skill_id == -1) Does it ever worked? + element = sstatus->rhw.ele;*/ if (element != ELE_NEUTRAL || !(battle_config.attack_attr_none&BL_PET)) dmg.damage=battle_attr_fix(src, bl, skill_lv, element, tstatus->def_ele, tstatus->ele_lv); else @@ -13570,7 +13570,8 @@ struct skill_condition skill_get_requirement(struct map_session_data* sd, uint16 } } if( skill_id >= HT_SKIDTRAP && skill_id <= HT_TALKIEBOX && pc_checkskill(sd, RA_RESEARCHTRAP) > 0){ - if( pc_search_inventory(sd,req.itemid[i]) < 0 || ( idx >= 0 && sd->status.inventory[idx].amount < req.amount[i] ) ){ + int16 itIndex; + if( (itIndex = pc_search_inventory(sd,req.itemid[i])) < 0 || ( itIndex >= 0 && sd->status.inventory[itIndex].amount < req.amount[i] ) ){ req.itemid[i] = ITEMID_TRAP_ALLOY; req.amount[i] = 1; } |