1
This commit is contained in:
parent
7b6ba13dd3
commit
e64c2d5767
@ -103,8 +103,8 @@ void Human::FillMFObjectFull(cs::MFObjectFull* full_data)
|
||||
int passed_time = (room->frame_no - jump_frameno) * FRAME_RATE_MS;
|
||||
cs::MFBodyState* state = p->add_states();
|
||||
state->set_state_type(3);
|
||||
state->set_left_time(std::max(0, MetaMgr::Instance()->jump_time - passed_time));
|
||||
state->set_lasting_time(MetaMgr::Instance()->jump_time);
|
||||
state->set_left_time(std::min(0, MetaMgr::Instance()->jump_time * 1000 - passed_time));
|
||||
state->set_lasting_time(MetaMgr::Instance()->jump_time * 1000);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -403,7 +403,8 @@ void Player::UpdateJump()
|
||||
if (a8::HasBitFlag(status, HS_Fly)) {
|
||||
DoJump();
|
||||
room->xtimer.AddDeadLineTimerAndAttach(SERVER_FRAME_RATE * 3,
|
||||
a8::XParams(),
|
||||
a8::XParams()
|
||||
.SetSender(this),
|
||||
[] (const a8::XParams& param)
|
||||
{
|
||||
Human* hum = (Human*)param.sender.GetUserData();
|
||||
@ -793,12 +794,14 @@ void Player::_CMMove(f8::MsgHdr& hdr, const cs::CMMove& msg)
|
||||
#if 0
|
||||
moving = msg.has_move_dir();
|
||||
#endif
|
||||
if (msg.has_attack_dir()) {
|
||||
attack_dir.FromPB(&msg.attack_dir());
|
||||
attack_dir.Normalize();
|
||||
} else {
|
||||
if (moving) {
|
||||
attack_dir = move_dir;
|
||||
if (!a8::HasBitFlag(status, HS_Fly)) {
|
||||
if (msg.has_attack_dir()) {
|
||||
attack_dir.FromPB(&msg.attack_dir());
|
||||
attack_dir.Normalize();
|
||||
} else {
|
||||
if (moving) {
|
||||
attack_dir = move_dir;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (moving) {
|
||||
@ -1097,6 +1100,11 @@ void Player::MakeUpdateMsg()
|
||||
}
|
||||
}
|
||||
}
|
||||
if (room->gas_data.gas_mode == GasJump) {
|
||||
cs::MFPlane* p = update_msg->mutable_plane();
|
||||
room->plane.start_point.ToPB(p->mutable_start_point());
|
||||
room->plane.end_point.ToPB(p->mutable_end_point());
|
||||
}
|
||||
if (send_update_msg_times == 0) {
|
||||
room->FetchBuilding(this);
|
||||
}
|
||||
|
@ -1054,6 +1054,7 @@ void Room::ShuaPlane()
|
||||
plane.start_point = Vector2D(100, 100);
|
||||
plane.end_point = Vector2D(7500, 7500);
|
||||
plane.dir = plane.end_point - plane.start_point;
|
||||
plane.dir.Normalize();
|
||||
plane.curr_pos = plane.start_point;
|
||||
|
||||
std::vector<Human*> humans;
|
||||
|
Loading…
x
Reference in New Issue
Block a user