This commit is contained in:
aozhiwei 2023-05-31 12:08:47 +08:00
parent 7a7563109d
commit debf6938e5
2 changed files with 16 additions and 0 deletions

View File

@ -71,6 +71,8 @@ class Human : public Creature
std::shared_ptr<cs::MFThrow> throw_bomb;
std::map<int, std::shared_ptr<cs::MFThrow>> pending_throw_bomb;
std::shared_ptr<glm::vec3> sand_table_target_pos;
std::shared_ptr<glm::vec3> shot_target_pos;
std::shared_ptr<glm::vec3> shot_client_pos;
std::string name;
std::string avatar_url;

View File

@ -1130,6 +1130,20 @@ void Player::_CMMove(f8::MsgHdr& hdr, const cs::CMMove& msg)
GetMovement()->CalcTargetPos(distance);
}
}
if (msg.has_shot_target_pos() &&
msg.has_shot_client_pos()) {
if (!shot_target_pos) {
shot_target_pos = std::make_shared<glm::vec3>(0.0f, 0.0f, 0.0f);
}
if (!shot_client_pos) {
shot_client_pos = std::make_shared<glm::vec3>(0.0f, 0.0f, 0.0f);
}
TypeConvert::FromPb(*shot_target_pos, &msg.shot_target_pos());
TypeConvert::FromPb(*shot_client_pos, &msg.shot_client_pos());
} else {
shot_target_pos = nullptr;
shot_client_pos = nullptr;
}
last_cmmove_frameno = room->GetFrameNo();
trace_target_uniid = msg.trace_target_uniid();
#ifdef DEBUG1