1
This commit is contained in:
parent
c22ae8e67c
commit
4ad43ff7da
@ -105,8 +105,22 @@ void SprintBuff::CoCollisionCheck()
|
||||
void SprintBuff::Check(Position& pre_pos, std::map<int, long long>& hited_objects)
|
||||
{
|
||||
if (pre_pos.ManhattanDistance2D(owner->GetPos()) < 2) {
|
||||
++stop_times_;
|
||||
if (stop_times_ > 3) {
|
||||
owner->room->xtimer.SetTimeoutEx
|
||||
(
|
||||
1,
|
||||
[this] (int event, const a8::Args* args)
|
||||
{
|
||||
if (a8::TIMER_EXEC_EVENT == event) {
|
||||
owner->RemoveBuffByUniId(buff_uniid);
|
||||
}
|
||||
},
|
||||
&xtimer_attacher);
|
||||
}
|
||||
return;
|
||||
}
|
||||
stop_times_ = 0;
|
||||
|
||||
glm::vec3 dir = owner->GetPos().ToGlmVec3() - pre_pos.ToGlmVec3();
|
||||
dir.y = 0.0f;
|
||||
|
@ -16,4 +16,5 @@ class SprintBuff : public Buff
|
||||
void OnEnemyHit(Creature* enemy);
|
||||
void ProcSkill();
|
||||
|
||||
int stop_times_ = 0;
|
||||
};
|
||||
|
@ -110,7 +110,7 @@ void Movement::CalcTargetPos(float distance)
|
||||
point.tar_pos.GetZ() < 0) {
|
||||
abort();
|
||||
}
|
||||
#ifdef DEBUG
|
||||
#ifdef DEBUG1
|
||||
if (owner_->IsPlayer()) {
|
||||
a8::XPrintf("CalcTargetPos src_pos:%f,%f,%f tar_pos:%f,%f,%f is_hit:%d start:%f,%f,%f end:%f,%f,%f distance:%f src_distance:%f\n",
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user