Skip to content

Commit

Permalink
Fixed #32 - Moving Platform jitter/desync
Browse files Browse the repository at this point in the history
  • Loading branch information
HumanGamer committed Aug 12, 2021
1 parent 303b48d commit a53dff5
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions engine/source/interior/pathedInterior.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ IMPLEMENT_CO_DATABLOCK_V1(PathedInteriorData);

//--------------------------------------------------------------------------

static U32 sNextNetUpdateInit = 0;

PathedInteriorData::PathedInteriorData()
{
for (U32 i = 0; i < MaxSounds; i++)
Expand Down Expand Up @@ -102,9 +100,14 @@ PathedInterior::PathedInterior()

mNextPathedInterior = NULL;

U32 oldNextNetUpdateInit = sNextNetUpdateInit;
sNextNetUpdateInit += UpdateTicksInc;
mNextNetUpdate = oldNextNetUpdateInit % UpdateTicks;
// The following code was used on both MBU(X360) and MBO(PC)
// While MBO wasn't affected for some reason that we have yet to figure out,
// Removing this fixes the de-sync with moving platforms.
//static U32 sNextNetUpdateInit = 0;
//mNextNetUpdate = sNextNetUpdateInit % UpdateTicks;
//sNextNetUpdateInit = sNextNetUpdateInit + 5;

mNextNetUpdate = 0;

mBaseTransform = MatrixF(true);
}
Expand Down

0 comments on commit a53dff5

Please sign in to comment.