diff options
author | Skotlex <Skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2011-08-23 17:30:08 +0000 |
---|---|---|
committer | Skotlex <Skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2011-08-23 17:30:08 +0000 |
commit | bb9704555b413ab267771434546f3eb05c0147da (patch) | |
tree | 76f2b09d818d82740642837a699a7d67e7a56dfb /src/map/unit.c | |
parent | 67466ae983ea6e2568b3e017c5d1976850308a2a (diff) | |
download | hercules-bb9704555b413ab267771434546f3eb05c0147da.tar.gz hercules-bb9704555b413ab267771434546f3eb05c0147da.tar.bz2 hercules-bb9704555b413ab267771434546f3eb05c0147da.tar.xz hercules-bb9704555b413ab267771434546f3eb05c0147da.zip |
- Rewrote/updated the SC_COMBO logic. Got rid of state.combo and added usage of packet 0x7e1 (PACKET_ZC_SKILLINFO_UPDATE2) to report skill inf changes.
- Cleaned up a bit the function clif_setlevel (these functions should be as lightweight as possible...)
- Fixed the server sending twice the skill tree during login.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14939 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/unit.c')
-rw-r--r-- | src/map/unit.c | 31 |
1 files changed, 16 insertions, 15 deletions
diff --git a/src/map/unit.c b/src/map/unit.c index 2165532b4..09a19e27d 100644 --- a/src/map/unit.c +++ b/src/map/unit.c @@ -912,7 +912,7 @@ int unit_skilluse_id2(struct block_list *src, int target_id, short skill_num, sh struct map_session_data *sd = NULL; struct block_list * target = NULL; unsigned int tick = gettick(); - int temp; + int temp = 0; nullpo_ret(src); if(status_isdead(src)) @@ -927,14 +927,21 @@ int unit_skilluse_id2(struct block_list *src, int target_id, short skill_num, sh sc = NULL; //Unneeded //temp: used to signal combo-skills right now. - temp = ( target_id == src->id && - ( - ( !(skill_get_inf(skill_num)&INF_SELF_SKILL) && sd && sd->state.combo ) || - ( skill_get_inf(skill_num)&INF_SELF_SKILL && skill_get_inf2(skill_num)&INF2_NO_TARGET_SELF ) - ) - ); - if (temp) - target_id = ud->target; //Auto-select skills. [Skotlex] + if (sc && sc->data[SC_COMBO] && sc->data[SC_COMBO]->val1 == skill_num) + { + if (sc->data[SC_COMBO]->val2) + target_id = sc->data[SC_COMBO]->val2; + else + target_id = ud->target; + temp = 1; + } else + if ( target_id == src->id && + skill_get_inf(skill_num)&INF_SELF_SKILL && + skill_get_inf2(skill_num)&INF2_NO_TARGET_SELF ) + { + target_id = ud->target; //Auto-select target. [Skotlex] + temp = 1; + } if (sd) { //Target_id checking. @@ -949,12 +956,6 @@ int unit_skilluse_id2(struct block_list *src, int target_id, short skill_num, sh return 0; } break; - case TK_JUMPKICK: - case TK_COUNTER: - case HT_POWER: - if (sc && sc->data[SC_COMBO] && sc->data[SC_COMBO]->val1 == skill_num) - target_id = sc->data[SC_COMBO]->val2; - break; case WE_MALE: case WE_FEMALE: if (!sd->status.partner_id) |