Skip to content

Commit

Permalink
host.c : Reduced server time in case of hoast_maxfps > 72
Browse files Browse the repository at this point in the history
  • Loading branch information
vsonnier committed Feb 5, 2025
1 parent 6b61602 commit 60957d1
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion Quake/host.c
Original file line number Diff line number Diff line change
Expand Up @@ -922,7 +922,22 @@ void _Host_Frame (double time)
double realframetime = host_frametime;
if (host_netinterval && isDedicated == 0)
{
host_frametime = sv.active ? (listening ? q_min (accumtime, 0.017) : host_netinterval) : accumtime;
if (sv.active)
{
if (listening)
{
host_frametime = q_min (accumtime, 0.017);
}
else
{
host_frametime = q_max (accumtime, host_netinterval);
}
}
else
{
host_frametime = accumtime;
}

accumtime -= host_frametime;
if (host_timescale.value > 0)
host_frametime *= host_timescale.value;
Expand Down

2 comments on commit 60957d1

@j4reporting
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this could be reduced to
host_frametime = listening ? q_min (accumtime, 0.017) : q_max (accumtime, host_netinterval);

q_max(accumtime, host_netinterval); takes care of the disconnected state because accumtime >= host_netinterval

@j4reporting
Copy link
Contributor

@j4reporting j4reporting commented on 60957d1 Feb 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

on closer look, for the listener server q_min (accumtime, 0.017) does not make sense either :)
Should be q_max in this case. hm, that might lead to situation that host_frametime > accumtime. Best to get rid of it.
This was only needed when host_frametime = host_netinterval.

This is because of d56b859 I would rather not touch it

Please # to comment.