diff --git a/server/gameserver/player.cc b/server/gameserver/player.cc index 608e2bb0..08db6e3b 100644 --- a/server/gameserver/player.cc +++ b/server/gameserver/player.cc @@ -2,6 +2,7 @@ #include #include +#include #include #include @@ -762,16 +763,12 @@ void Player::_CMMove(f8::MsgHdr& hdr, const cs::CMMove& msg) moving = false; if (msg.has_move_dir()) { if (std::abs(msg.move_dir().x()) > FLT_EPSILON || - std::abs(msg.move_dir().y()) > FLT_EPSILON + std::abs(msg.move_dir().y()) > FLT_EPSILON || + std::abs(msg.move_dir().z()) > FLT_EPSILON ) { glm::vec3 old_move_dir; glm::vec3 new_move_dir; TypeConvert::FromPb(new_move_dir, &msg.move_dir()); - // 666 - #if 1 - new_move_dir.z = new_move_dir.y; - new_move_dir.y = 0.0f; - #endif if (!HasBuffEffect(kBET_Vertigo)) { if (!(HasBuffEffect(kBET_Jump) && follow_target.Get())) { if (GetDisableMoveDirTimes() <= 0) { @@ -788,10 +785,11 @@ void Player::_CMMove(f8::MsgHdr& hdr, const cs::CMMove& msg) } } } - assert(!isnan(GetMoveDir().x) && !isnan(GetMoveDir().y)); + assert(!isnan(GetMoveDir().x) && !isnan(GetMoveDir().y) && !isnan(GetMoveDir().z)); if (msg.has_attack_dir()) { if (std::isfinite(msg.attack_dir().x()) && std::isfinite(msg.attack_dir().y()) && + std::isfinite(msg.attack_dir().z()) && ( std::abs(msg.attack_dir().x()) > 0.00001f || std::abs(msg.attack_dir().y()) > 0.00001f || @@ -818,12 +816,7 @@ void Player::_CMMove(f8::MsgHdr& hdr, const cs::CMMove& msg) if (can_set) { if (GetDisableMoveDirTimes() <= 0 && GetDisableAttackDirTimes() <= 0) { - // 666 - #if 1 - glm::vec3 attack_dir(msg.attack_dir().x(), msg.attack_dir().z(), msg.attack_dir().y()); - #else glm::vec3 attack_dir(msg.attack_dir().x(), msg.attack_dir().y(), msg.attack_dir().z()); - #endif GlmHelper::Normalize(attack_dir); SetAttackDir(attack_dir); if (GetCar() && GetCar()->IsDriver(this)) { diff --git a/server/gameserver/typeconvert.cc b/server/gameserver/typeconvert.cc index 403fc83c..142d1b78 100644 --- a/server/gameserver/typeconvert.cc +++ b/server/gameserver/typeconvert.cc @@ -9,28 +9,16 @@ namespace TypeConvert void ToPb(const Position v, cs::MFVec3* pb_obj) { -#ifdef SXY - pb_obj->set_x(v.x); - pb_obj->set_y(v.z); - pb_obj->set_z(v.y); -#else pb_obj->set_x(v.x); pb_obj->set_y(v.y); pb_obj->set_z(v.z); -#endif } void ToPb(const glm::vec3& v, cs::MFVec3* pb_obj) { -#ifdef SXY - pb_obj->set_x(v.x); - pb_obj->set_y(v.z); - pb_obj->set_z(v.y); -#else pb_obj->set_x(v.x); pb_obj->set_y(v.y); pb_obj->set_z(v.z); -#endif } void ToPb(const a8::Vec3& v, cs::MFVec3* pb_obj)