Skip to content

Commit

Permalink
Merge pull request #514 from DileSoft/network_stability
Browse files Browse the repository at this point in the history
Network stability
  • Loading branch information
stalkerg authored Nov 17, 2021
2 parents 12bc27e + f3f42d6 commit 4d6eb2a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
6 changes: 3 additions & 3 deletions src/network.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -728,9 +728,9 @@ int InputEventBuffer::next_event() {
ignore_event();
if(!lag_averaging_t0.empty()) {
int dt = (int)(SDL_GetTicks() - lag_averaging_t0.get());
if(dt > 100 && dt < 20000) {
average_lag = (dt + average_lag*3) >> 2;
}
// if(dt > 100 && dt < 20000) {
average_lag = dt;
// }
}
}
body_size = 0;
Expand Down
11 changes: 7 additions & 4 deletions src/particle/light.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -209,10 +209,13 @@ int LightPoint::quant(void) {
int _x2 = ((x+R-j-2) & clip_mask_x)|1;
j += 2;
//Sectors light around point (light under pulse)
llt = lt[_y] + _x;
llt1 = lt[_y1] + _x;
llt2 = lt[_y]+_x2;
llt3 = lt[_y1]+_x2;
llt = lt[YCYCL(_y)] + XCYCL(_x);
llt1 = lt[YCYCL(_y1)] + XCYCL(_x);
llt2 = lt[YCYCL(_y)]+XCYCL(_x2);
llt3 = lt[YCYCL(_y1)]+XCYCL(_x2);
if (!lt[YCYCL(_y)] || !lt[YCYCL(_y1)]) {
continue;
}
int r4=(R*2-dimR[j]-dimR[R-i]);
int r, first_shift;
if ( (*llt) < _z ){
Expand Down

0 comments on commit 4d6eb2a

Please sign in to comment.