修复发射速度问题

This commit is contained in:
aozhiwei 2019-04-11 17:55:06 +08:00
parent 6f678e0004
commit d86d5f6d2f
2 changed files with 9 additions and 1 deletions

View File

@ -118,7 +118,13 @@ void Player::UpdateShot()
if (series_shot_frames > 4) {
shot_hold = false;
series_shot_frames = 0;
Shot();
if (last_shot_frameno_ == 0 ||
(
(room->frame_no - last_shot_frameno_) * (1000 / SERVER_FRAME_RATE)) >
curr_weapon->meta->i->fire_rate()
) {
Shot();
}
}
}
}
@ -388,6 +394,7 @@ void Player::Shot()
}
break;
}
last_shot_frameno_ = room->frame_no;
need_sync_active_player = true;
}

View File

@ -97,6 +97,7 @@ class Player : public Human
private:
int send_update_msg_times = 0;
long long last_shot_frameno_ = 0;
cs::SMUpdate* update_msg = nullptr;
long long last_sync_gas_frameno = 0;
void MakeUpdateMsg();