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()) { if (!m->IsAndroid()) {
Player* hum = InternalCreatePlayer(p, m, room_team); Player* hum = InternalCreatePlayer(p, m, room_team);
//hum->is_client_move = m->GetCMJoinMsg()->is_client_move(); if (m->GetCMJoinMsg()) {
hum->is_client_move = 1; hum->is_client_move = m->GetCMJoinMsg()->is_client_move();
}
//hum->is_client_move = 1;
} else { } else {
Human* hum = CreateAndroidWithCustomMember(m, room_team); Human* hum = CreateAndroidWithCustomMember(m, room_team);
} }
@ -2729,7 +2731,7 @@ int Room::JoinWithCustomBattle(std::shared_ptr<CustomBattle> p)
a8::SetBitFlag(hum->status, CS_IsOb); a8::SetBitFlag(hum->status, CS_IsOb);
p->GetRoom()->GetRoomOb()->AddOb(hum); 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; 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_; long long pre_frameno = last_cmmove_frameno_;
last_cmmove_frameno_ = room->GetFrameNo(); last_cmmove_frameno_ = room->GetFrameNo();
moving = false; moving = false;
if (!msg.has_attack_dir()) { if (IsClientMove() && !msg.has_attack_dir()) {
if (msg.has_move_dir()) { if (msg.has_move_dir()) {
*(((cs::CMMove*)&msg)->mutable_attack_dir()) = msg.move_dir(); *(((cs::CMMove*)&msg)->mutable_attack_dir()) = msg.move_dir();
} }