This commit is contained in:
aozhiwei 2023-06-14 17:24:57 +08:00
parent 12e837a113
commit 6b19afac51

View File

@ -2366,7 +2366,18 @@ void Creature::UpdateMove()
}
}
room->grid_service->MoveCreature(this);
if (room->IsPveRoom() && IsEntityType(ET_Hero) && IsNearGas()) {
if (a8::HasBitFlag(status, CS_CrazeMode) && IsNearGas()) {
GetMutablePos() = old_pos;
GetMovement()->ClearPath();
glm::vec3 dir = GetPos().ToGlmVec3() - old_pos.ToGlmVec3();
if (std::abs(dir.x) > FLT_EPSILON ||
std::abs(dir.y) > FLT_EPSILON ||
std::abs(dir.z) > FLT_EPSILON
) {
GlmHelper::Normalize(dir);
SetMoveDir(dir);
}
} else if (room->IsPveRoom() && IsEntityType(ET_Hero) && IsNearGas()) {
GetMutablePos() = old_pos;
GetMovement()->ClearPath();
glm::vec3 dir = GetPos().ToGlmVec3() - old_pos.ToGlmVec3();