还原代码

This commit is contained in:
aozhiwei 2020-04-30 10:53:58 +08:00
parent 03099c0e7c
commit b8f35857b4

View File

@ -572,61 +572,6 @@ void Human::FindPathInMapService()
}
}
SetPos(old_pos);
if (entity_subtype == EST_Player && last_collider && last_collider->type == CT_Aabb) {
#if 0
AabbCollider* aabb_collider = (AabbCollider*)last_collider;
#endif
if (GetPos().x > last_collider->owner->GetPos().x) {
//在右边
if (GetPos().y > last_collider->owner->GetPos().y) {
//右上
#ifdef DEBUG
a8::XPrintf("右上\n", {});
#endif
if (move_dir.Dot(a8::Vec2(1, -1)) > 0.000002f) {
SetPos(old_pos + a8::Vec2(2, 0));
} else {
SetPos(old_pos + a8::Vec2(0, 2));
}
} else {
//右下
#ifdef DEBUG
a8::XPrintf("右下\n", {});
#endif
if (move_dir.Dot(a8::Vec2(-1, 1)) > 0.000002f) {
SetPos(old_pos + a8::Vec2(2, 0));
} else {
SetPos(old_pos + a8::Vec2(0, -2));
}
}
} else {
//左边
if (GetPos().y > last_collider->owner->GetPos().y) {
//左上
#ifdef DEBUG
a8::XPrintf("左上\n", {});
#endif
if (move_dir.Dot(a8::Vec2(-1, -1)) > 0.000001f) {
SetPos(old_pos + a8::Vec2(-2, 0));
} else {
SetPos(old_pos + a8::Vec2(0, 2));
}
} else {
//左下
#ifdef DEBUG
a8::XPrintf("左下\n", {});
#endif
if (move_dir.Dot(a8::Vec2(1, -1)) > 0.000001f) {
SetPos(old_pos + a8::Vec2(-2, 0));
} else {
SetPos(old_pos + a8::Vec2(0, -2));
}
}
}
}
if (IsCollisionInMapService()) {
SetPos(old_pos);
}
}
float Human::GetRadius()