This commit is contained in:
aozhiwei 2019-05-13 15:40:02 +08:00
commit c2266bf640
2 changed files with 10 additions and 3 deletions

View File

@ -811,8 +811,16 @@ void Player::_CMMove(f8::MsgHdr& hdr, const cs::CMMove& msg)
#endif #endif
if (!a8::HasBitFlag(status, HS_Fly)) { if (!a8::HasBitFlag(status, HS_Fly)) {
if (msg.has_attack_dir()) { if (msg.has_attack_dir()) {
attack_dir.FromPB(&msg.attack_dir()); if (std::isfinite(msg.attack_dir().x()) &&
attack_dir.Normalize(); std::isfinite(msg.attack_dir().y()) &&
(
std::abs(msg.attack_dir().x()) > 0.00001f ||
std::abs(msg.attack_dir().y()) > 0.00001f
)
){
attack_dir.FromPB(&msg.attack_dir());
attack_dir.Normalize();
}
} else { } else {
if (moving) { if (moving) {
attack_dir = move_dir; attack_dir = move_dir;

View File

@ -49,7 +49,6 @@ message SafeArea
message Item message Item
{ {
optional int32 id = 1; //id optional int32 id = 1; //id
optional int32 type = 2; //
} }
message Equip message Equip