This commit is contained in:
aozhiwei 2024-09-24 13:41:39 +08:00
parent b7279a098b
commit 49c9616b23
2 changed files with 6 additions and 4 deletions

View File

@ -2680,8 +2680,10 @@ int Room::JoinWithCustomBattle(std::shared_ptr<CustomBattle> p)
{
if (!m->IsAndroid()) {
Player* hum = InternalCreatePlayer(p, m, room_team);
//hum->is_client_move = m->GetCMJoinMsg()->is_client_move();
hum->is_client_move = 1;
if (m->GetCMJoinMsg()) {
hum->is_client_move = m->GetCMJoinMsg()->is_client_move();
}
//hum->is_client_move = 1;
} else {
Human* hum = CreateAndroidWithCustomMember(m, room_team);
}
@ -2729,7 +2731,7 @@ int Room::JoinWithCustomBattle(std::shared_ptr<CustomBattle> p)
a8::SetBitFlag(hum->status, CS_IsOb);
p->GetRoom()->GetRoomOb()->AddOb(hum);
});
hum->is_client_move = m->GetCMJoinMsg()->is_client_move();
//hum->is_client_move = m->GetCMJoinMsg()->is_client_move();
return true;
});
}

View File

@ -1017,7 +1017,7 @@ void Player::_CMMove(f8::MsgHdr* hdr, const cs::CMMove& msg)
long long pre_frameno = last_cmmove_frameno_;
last_cmmove_frameno_ = room->GetFrameNo();
moving = false;
if (!msg.has_attack_dir()) {
if (IsClientMove() && !msg.has_attack_dir()) {
if (msg.has_move_dir()) {
*(((cs::CMMove*)&msg)->mutable_attack_dir()) = msg.move_dir();
}