diff options
author | ultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2008-02-03 23:26:00 +0000 |
---|---|---|
committer | ultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2008-02-03 23:26:00 +0000 |
commit | b317caf7a7de3b2a4a64613aee576fd595aaca14 (patch) | |
tree | 1f4ef799df9e0b4fc8d712ab9ba5cc376095e023 /src/map/status.c | |
parent | 42817756b603d2dc76c1408d0a6f432673350bd7 (diff) | |
download | hercules-b317caf7a7de3b2a4a64613aee576fd595aaca14.tar.gz hercules-b317caf7a7de3b2a4a64613aee576fd595aaca14.tar.bz2 hercules-b317caf7a7de3b2a4a64613aee576fd595aaca14.tar.xz hercules-b317caf7a7de3b2a4a64613aee576fd595aaca14.zip |
Fixes to Devotion (see topic:153345)
- removed totally fake Devotion packet from Marionette Control code (see r3934)
- fixed one devoted chars array management code bug which caused chars to be included in the array multiple times, producing various problems (also see r3934)
- the link will now re-display when coming into view range
- the link will no longer break if the devotee walks away, but instead, if he receives damage while being out of range of Devotion
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@12171 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/status.c')
-rw-r--r-- | src/map/status.c | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/src/map/status.c b/src/map/status.c index 748be46ca..6ea757d2b 100644 --- a/src/map/status.c +++ b/src/map/status.c @@ -647,7 +647,7 @@ int status_damage(struct block_list *src,struct block_list *target,int hp, int s if ((sce=sc->data[SC_DEVOTION]) && src && battle_getcurrentskill(src) != PA_PRESSURE) { //Devotion prevents any of the other ailments from ending. struct map_session_data *sd2 = map_id2sd(sce->val1); - if (sd2 && sd2->devotion[sce->val2] == target->id) + if (sd2 && sd2->devotion[sce->val2] == target->id && check_distance_bl(target, &sd2->bl, sce->val3)) { clif_damage(&sd2->bl, &sd2->bl, gettick(), 0, 0, hp, 0, 0, 0); status_fix_damage(NULL, &sd2->bl, hp, 0); @@ -6322,7 +6322,7 @@ int status_change_end(struct block_list* bl, enum sc_type type, int tid) if (md) { md->devotion[sce->val2] = 0; - clif_devotion(md); + clif_devotion(md,NULL); } //Remove inherited status [Skotlex] if (sc->data[SC_AUTOGUARD]) @@ -6333,8 +6333,8 @@ int status_change_end(struct block_list* bl, enum sc_type type, int tid) status_change_end(bl,SC_REFLECTSHIELD,-1); if (sc->data[SC_ENDURE]) status_change_end(bl,SC_ENDURE,-1); - break; } + break; case SC_BLADESTOP: if(sce->val4) { @@ -6431,8 +6431,6 @@ int status_change_end(struct block_list* bl, enum sc_type type, int tid) status_change_end(pbl, type2, -1); } } - if (type == SC_MARIONETTE) - clif_marionette(bl, 0); //Clear effect. break; case SC_BERSERK: @@ -6906,14 +6904,11 @@ int status_change_timer(int tid, unsigned int tick, int id, int data) break; case SC_DEVOTION: - { //Check range and timeleft to preserve status [Skotlex] - //This implementation won't work for mobs because of map_id2sd, but it's a small cost in exchange of the speed of map_id2sd over map_id2bl - struct map_session_data *md = map_id2sd(sce->val1); - if (md && check_distance_bl(bl, &md->bl, sce->val3) && (sce->val4-=1000)>0) - { - sc_timer_next(1000+tick, status_change_timer, bl->id, data); - return 0; - } + //FIXME: use normal status duration instead of a looping timer + if( (sce->val4 -= 1000) > 0 ) + { + sc_timer_next(1000+tick, status_change_timer, bl->id, data); + return 0; } break; |