1
This commit is contained in:
parent
a85c25288a
commit
cf9611cce2
@ -6,10 +6,10 @@
|
||||
#include "skillhelper.h"
|
||||
#include "skill.h"
|
||||
#include "room.h"
|
||||
#include "human.h"
|
||||
#include "ability.h"
|
||||
#include "collision.h"
|
||||
#include "lispenv.h"
|
||||
#include "movement.h"
|
||||
|
||||
#include "mt/Buff.h"
|
||||
#include "mt/Skill.h"
|
||||
@ -27,6 +27,9 @@ void SprintBuff::Activate()
|
||||
void SprintBuff::Deactivate()
|
||||
{
|
||||
int i = 0;
|
||||
if (!owner->room->IsDestorying()) {
|
||||
owner->GetMovement()->ClearPath();
|
||||
}
|
||||
}
|
||||
|
||||
void SprintBuff::SprintMove()
|
||||
@ -56,18 +59,17 @@ void SprintBuff::SprintMove()
|
||||
[this] (int event, const a8::Args* args)
|
||||
{
|
||||
if (a8::TIMER_EXEC_EVENT == event) {
|
||||
Human* hum = owner->AsHuman();
|
||||
a8::XPrintf("%s\n",
|
||||
{
|
||||
a8::Format("xxxxxxxx move_dir:%f,%f,%f attack_dir:%f,%f,%f speed:%d",
|
||||
{
|
||||
hum->GetMoveDir().x,
|
||||
hum->GetMoveDir().y,
|
||||
hum->GetMoveDir().z,
|
||||
hum->GetAttackDir().x,
|
||||
hum->GetAttackDir().y,
|
||||
hum->GetAttackDir().z,
|
||||
hum->GetSpeed()
|
||||
owner->GetMoveDir().x,
|
||||
owner->GetMoveDir().y,
|
||||
owner->GetMoveDir().z,
|
||||
owner->GetAttackDir().x,
|
||||
owner->GetAttackDir().y,
|
||||
owner->GetAttackDir().z,
|
||||
owner->GetSpeed()
|
||||
})
|
||||
});
|
||||
}
|
||||
@ -176,6 +178,7 @@ void SprintBuff::SprintEnd()
|
||||
{
|
||||
if (a8::TIMER_EXEC_EVENT == event) {
|
||||
owner->TryAddBuff(owner, meta->_int_buff_param1, skill_meta);
|
||||
owner->GetMovement()->ClearPath();
|
||||
owner->RemoveBuffByUniId(buff_uniid);
|
||||
}
|
||||
},
|
||||
|
@ -23,6 +23,7 @@
|
||||
#include "stats.h"
|
||||
#include "hero.h"
|
||||
#include "skill.h"
|
||||
#include "movement.h"
|
||||
|
||||
#include "mt/Hero.h"
|
||||
#include "mt/Equip.h"
|
||||
@ -576,6 +577,27 @@ void Car::DoSkillPostProc(bool used, int skill_id, int target_id)
|
||||
void Car::Update(int delta_time)
|
||||
{
|
||||
++updated_times_;
|
||||
if (GetMovement()->GetPathSize() > 0 ||
|
||||
HasBuffEffect(kBET_Sprint)) {
|
||||
Global::Instance()->verify_set_pos = 1;
|
||||
UpdateMove();
|
||||
Global::Instance()->verify_set_pos = 0;
|
||||
if (GetDriver()) {
|
||||
Global::Instance()->verify_set_pos = 1;
|
||||
GetDriver()->SetPos(GetPos());
|
||||
Global::Instance()->verify_set_pos = 0;
|
||||
}
|
||||
SyncPos();
|
||||
#ifdef DEBUG1
|
||||
a8::XPrintf("updatemove old_pos:%f,%f new_pos:%f,%f\n",
|
||||
{
|
||||
old_pos.x,
|
||||
old_pos.y,
|
||||
GetPos().x,
|
||||
GetPos().y,
|
||||
});
|
||||
#endif
|
||||
}
|
||||
if (playing_skill) {
|
||||
UpdateSkill();
|
||||
}
|
||||
|
@ -2351,7 +2351,11 @@ void Creature::UpdateMove()
|
||||
} else {
|
||||
GetMovement()->CalcTargetPos(mt::Param::s().move_step_len);
|
||||
if (!GetMovement()->UpdatePosition()) {
|
||||
#if 1
|
||||
{
|
||||
#else
|
||||
if (IsPlayer()) {
|
||||
#endif
|
||||
if (HasBuffEffect(kBET_Sprint)) {
|
||||
SprintBuff* buff = (SprintBuff*)GetBuffByEffectId(kBET_Sprint);
|
||||
if (buff) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user