修复发射速度问题
This commit is contained in:
parent
6f678e0004
commit
d86d5f6d2f
@ -118,10 +118,16 @@ void Player::UpdateShot()
|
|||||||
if (series_shot_frames > 4) {
|
if (series_shot_frames > 4) {
|
||||||
shot_hold = false;
|
shot_hold = false;
|
||||||
series_shot_frames = 0;
|
series_shot_frames = 0;
|
||||||
|
if (last_shot_frameno_ == 0 ||
|
||||||
|
(
|
||||||
|
(room->frame_no - last_shot_frameno_) * (1000 / SERVER_FRAME_RATE)) >
|
||||||
|
curr_weapon->meta->i->fire_rate()
|
||||||
|
) {
|
||||||
Shot();
|
Shot();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void Player::UpdateSelectWeapon()
|
void Player::UpdateSelectWeapon()
|
||||||
{
|
{
|
||||||
@ -388,6 +394,7 @@ void Player::Shot()
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
last_shot_frameno_ = room->frame_no;
|
||||||
need_sync_active_player = true;
|
need_sync_active_player = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -97,6 +97,7 @@ class Player : public Human
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
int send_update_msg_times = 0;
|
int send_update_msg_times = 0;
|
||||||
|
long long last_shot_frameno_ = 0;
|
||||||
cs::SMUpdate* update_msg = nullptr;
|
cs::SMUpdate* update_msg = nullptr;
|
||||||
long long last_sync_gas_frameno = 0;
|
long long last_sync_gas_frameno = 0;
|
||||||
void MakeUpdateMsg();
|
void MakeUpdateMsg();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user