This commit is contained in:
aozhiwei 2022-12-28 14:23:47 +08:00
parent 9ed987c69e
commit 05ebd8d2bb

View File

@ -19,6 +19,7 @@
#include "ability.h"
#include "battledatacontext.h"
#include "buff.h"
#include "mapinstance.h"
#include "mt/Param.h"
#include "mt/Hero.h"
@ -3191,7 +3192,21 @@ void Creature::UpdateMove()
void Creature::ForwardMove(float distance)
{
GetMovement()->CalcTargetPos(distance);
Position pos = GetPos();
glm::vec3 start = GetPos().ToGlmVec3();
glm::vec3 end = pos.AddGlmVec3(GetMoveDir() * distance).ToGlmVec3();
glm::vec3 hit_point;
room->map_instance->Scale(start);
room->map_instance->Scale(end);
bool hit_result = false;
bool ret = room->map_instance->Raycast(0, start, end, hit_point, hit_result);
if (ret) {
room->map_instance->UnScale(hit_point);
}
CheckSpecObject();
}
bool Creature::HasSpecMove()