summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHaruna <haru@dotalux.com>2015-11-14 17:49:48 +0100
committerHaruna <haru@dotalux.com>2015-11-14 17:49:48 +0100
commit650727ddf52650283652a021539cef5e0d0df05b (patch)
treef4418e1892408964812f33ac0707c46cb6773f9e
parent7a56179426d488a351f05088d03ace75d6aca4f8 (diff)
parente3c8212c05c63e5e500710f151044de9e4a95257 (diff)
downloadhercules-650727ddf52650283652a021539cef5e0d0df05b.tar.gz
hercules-650727ddf52650283652a021539cef5e0d0df05b.tar.bz2
hercules-650727ddf52650283652a021539cef5e0d0df05b.tar.xz
hercules-650727ddf52650283652a021539cef5e0d0df05b.zip
Merge pull request #856 from 4144/fixhit
fix hit after warp.
-rw-r--r--conf/battle/player.conf3
-rw-r--r--src/map/battle.c12
-rw-r--r--src/map/battle.h2
3 files changed, 13 insertions, 4 deletions
diff --git a/conf/battle/player.conf b/conf/battle/player.conf
index babd6cfc3..cc2655580 100644
--- a/conf/battle/player.conf
+++ b/conf/battle/player.conf
@@ -51,6 +51,9 @@ basic_skill_check: yes
// Value is also affected by 'invincible_time_inc' mapflag
player_invincible_time: 5000
+// When set to true, it prevent portal abuse for avoid hits. Official value is false.
+fix_warp_hit_delay_abuse: false
+
// The time interval for HP to restore naturally. (in milliseconds)
natural_healhp_interval: 6000
diff --git a/src/map/battle.c b/src/map/battle.c
index 1cbc3baa5..10990f013 100644
--- a/src/map/battle.c
+++ b/src/map/battle.c
@@ -229,10 +229,13 @@ int battle_delay_damage_sub(int tid, int64 tick, int id, intptr_t data) {
src = map->id2bl(dat->src_id);
//Check to see if you haven't teleported. [Skotlex]
- if( src
- && (target->type != BL_PC || ((TBL_PC*)target)->invincible_timer == INVALID_TIMER)
- && (dat->skill_id == MO_EXTREMITYFIST || (target->m == src->m && check_distance_bl(src, target, dat->distance)) )
- ) {
+ if (src && (
+ battle_config.fix_warp_hit_delay_abuse ?
+ (dat->skill_id == MO_EXTREMITYFIST || target->m != src->m || check_distance_bl(src, target, dat->distance))
+ :
+ ((target->type != BL_PC || ((TBL_PC*)target)->invincible_timer == INVALID_TIMER)
+ && (dat->skill_id == MO_EXTREMITYFIST || (target->m == src->m && check_distance_bl(src, target, dat->distance))))
+ )) {
map->freeblock_lock();
status_fix_damage(src, target, dat->damage, dat->delay);
if( dat->attack_type && !status->isdead(target) && dat->additional_effects )
@@ -7136,6 +7139,7 @@ static const struct battle_data {
{ "boss_icewall_walk_block", &battle_config.boss_icewall_walk_block, 0, 0, 255, },
{ "feature.roulette", &battle_config.feature_roulette, 1, 0, 1, },
{ "show_monster_hp_bar", &battle_config.show_monster_hp_bar, 1, 0, 1, },
+ { "fix_warp_hit_delay_abuse", &battle_config.fix_warp_hit_delay_abuse, 0, 0, 1, },
};
#ifndef STATS_OPT_OUT
/**
diff --git a/src/map/battle.h b/src/map/battle.h
index 0ebc0aeb9..eeecaaf89 100644
--- a/src/map/battle.h
+++ b/src/map/battle.h
@@ -509,6 +509,8 @@ struct Battle_Config {
int feature_roulette;
int show_monster_hp_bar; // [Frost]
+
+ int fix_warp_hit_delay_abuse;
};
/* criteria for battle_config.idletime_critera */