Improved pdata update sync when firing and not limiting general use of the force flag
This commit is contained in:
parent
2e407fa5a8
commit
3e2fd4f74b
|
@ -2467,8 +2467,14 @@ multi_process_bigdata(const ubyte *buf, unsigned len)
|
|||
void multi_send_fire(int laser_gun, int laser_level, int laser_flags, int laser_fired, short laser_track, int is_bomb_objnum)
|
||||
{
|
||||
object* ownship = Objects + Players[Player_num].objnum;
|
||||
static fix64 last_fireup_time = 0;
|
||||
|
||||
multi_do_protocol_frame(1, 0); // provoke positional update if possible
|
||||
// provoke positional update if possible (20 times per second max. matches vulcan, the fastest firing weapon)
|
||||
if (timer_query() >= (last_fireup_time+(F1_0/20)))
|
||||
{
|
||||
multi_do_protocol_frame(1, 0);
|
||||
last_fireup_time = timer_query();
|
||||
}
|
||||
|
||||
multibuf[0] = (char)MULTI_FIRE;
|
||||
if (is_bomb_objnum > -1)
|
||||
|
|
|
@ -4167,8 +4167,8 @@ void net_udp_do_frame(int force, int listen)
|
|||
if (WaitForRefuseAnswer && time>(RefuseTimeLimit+(F1_0*12)))
|
||||
WaitForRefuseAnswer=0;
|
||||
|
||||
// Send positional update either in the regular PPS interval OR if forced AND at least every 66.6ms (nice for firing)
|
||||
if ((force && time >= (last_pdata_time+(F1_0/15))) || (time >= (last_pdata_time+(F1_0/Netgame.PacketsPerSec))))
|
||||
// Send positional update either in the regular PPS interval OR if forced
|
||||
if (force || (time >= (last_pdata_time+(F1_0/Netgame.PacketsPerSec))))
|
||||
{
|
||||
last_pdata_time = time;
|
||||
net_udp_send_pdata();
|
||||
|
|
Loading…
Reference in a new issue