summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2021-08-02 15:50:26 -0300
committerJesusaves <cpntb1@ymail.com>2021-08-02 15:50:26 -0300
commit52592e01511cb86c1f0f545be52c340d190546ec (patch)
treed1bbed12ae1d3ef2e0c3865d2a3940092db49713
parentecd7e57bec8bd85c6121004ec88376d7c7138d30 (diff)
downloadhercules-52592e01511cb86c1f0f545be52c340d190546ec.tar.gz
hercules-52592e01511cb86c1f0f545be52c340d190546ec.tar.bz2
hercules-52592e01511cb86c1f0f545be52c340d190546ec.tar.xz
hercules-52592e01511cb86c1f0f545be52c340d190546ec.zip
[TMW2] Partly reverts b5a92f944f126e920442307bebd3c2b53c9b0d54
This should kill lag. Maybe. Definitely. Hopefully.
-rw-r--r--src/map/battle.c2
-rw-r--r--src/map/unit.c7
2 files changed, 7 insertions, 2 deletions
diff --git a/src/map/battle.c b/src/map/battle.c
index 0567b245f..4b60ffb52 100644
--- a/src/map/battle.c
+++ b/src/map/battle.c
@@ -6967,12 +6967,14 @@ static bool battle_check_range(struct block_list *src, struct block_list *bl, in
if( src->m != bl->m )
return false;
+/* [TMW2] Code removed - ManaPlus deals with squares, not circles.
#ifndef CIRCULAR_AREA
if( src->type == BL_PC ) { // Range for players' attacks and skills should always have a circular check. [Angezerus]
if ( !check_distance_client_bl(src, bl, range) )
return false;
} else
#endif
+*/
if( !check_distance_bl(src, bl, range) )
return false;
diff --git a/src/map/unit.c b/src/map/unit.c
index ba055da02..5d0333bd8 100644
--- a/src/map/unit.c
+++ b/src/map/unit.c
@@ -412,12 +412,14 @@ static int unit_walktoxy_timer(int tid, int64 tick, int id, intptr_t data)
timer->delete(ud->steptimer, unit->step_timer);
ud->steptimer = INVALID_TIMER;
}
+ /* [TMW2] Remove this, ManaPlus cannot handle it
//Delay stepactions by half a step (so they are executed at full step)
if(ud->walkpath.path[ud->walkpath.path_pos]&1)
i = status->get_speed(bl)*14/20;
else
i = status->get_speed(bl)/2;
ud->steptimer = timer->add(tick+i, unit->step_timer, bl->id, 0);
+ */
}
if(ud->state.change_walk_target) {
@@ -1463,7 +1465,8 @@ static int unit_skilluse_id2(struct block_list *src, int target_id, uint16 skill
} else if( src->type == BL_MER && skill_id == MA_REMOVETRAP ) {
if( !battle->check_range(battle->get_master(src), target, range + 1) )
return 0; // Aegis calc remove trap based on Master position, ignoring mercenary O.O
- } else if (!battle->check_range(src, target, range)) {
+ // [TMW2] Reintroduce the arbitrary +1 range bonus (reduces lag)
+ } else if (!battle->check_range(src, target, range +1)) {
return 0; // Arrow-path check failed.
}
}
@@ -2183,7 +2186,7 @@ static int unit_attack_timer_sub(struct block_list *src, int tid, int64 tick)
}
sstatus = status->get_status_data(src);
- range = sstatus->rhw.range;
+ range = sstatus->rhw.range + 1; // [TMW2] Extra range for anti-lag
if( (unit->is_walking(target) || ud->state.step_attack)
&& (target->type == BL_PC || !map->getcell(target->m, src, target->x, target->y, CELL_CHKICEWALL)))