mirror of
https://github.com/genxium/DelayNoMore
synced 2024-12-26 11:48:56 +00:00
Fix on backend "createInputsBufferSnapshot".
This commit is contained in:
parent
26bdd41285
commit
17cac19c62
@ -1605,20 +1605,21 @@ func (pR *Room) downsyncToSinglePlayer(playerId int32, player *Player, refRender
|
|||||||
func (pR *Room) createInputsBufferSnapshot(stFrameId, edFrameId int32) []*InputFrameDownsync {
|
func (pR *Room) createInputsBufferSnapshot(stFrameId, edFrameId int32) []*InputFrameDownsync {
|
||||||
// [WARNING] This function MUST BE called while "pR.InputsBufferLock" is locked!
|
// [WARNING] This function MUST BE called while "pR.InputsBufferLock" is locked!
|
||||||
snapshot := make([]*InputFrameDownsync, 0, edFrameId-stFrameId)
|
snapshot := make([]*InputFrameDownsync, 0, edFrameId-stFrameId)
|
||||||
prevFrameFound := true
|
prevFrameFound := false
|
||||||
j := stFrameId
|
j := stFrameId
|
||||||
for j < edFrameId {
|
for j < edFrameId {
|
||||||
tmp := pR.InputsBuffer.GetByFrameId(j)
|
tmp := pR.InputsBuffer.GetByFrameId(j)
|
||||||
if nil == tmp {
|
if nil == tmp {
|
||||||
if false == prevFrameFound {
|
if false == prevFrameFound {
|
||||||
// The "id"s are always consecutive
|
j++
|
||||||
break
|
continue // allowed to keep not finding the requested inputFrames at the beginning
|
||||||
} else {
|
} else {
|
||||||
prevFrameFound = false
|
break // The "id"s are always consecutive
|
||||||
continue
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
prevFrameFound = true
|
||||||
foo := tmp.(*InputFrameDownsync)
|
foo := tmp.(*InputFrameDownsync)
|
||||||
|
|
||||||
bar := &InputFrameDownsync{
|
bar := &InputFrameDownsync{
|
||||||
InputFrameId: foo.InputFrameId,
|
InputFrameId: foo.InputFrameId,
|
||||||
InputList: make([]uint64, len(foo.InputList)),
|
InputList: make([]uint64, len(foo.InputList)),
|
||||||
|
@ -440,7 +440,7 @@
|
|||||||
"array": [
|
"array": [
|
||||||
0,
|
0,
|
||||||
0,
|
0,
|
||||||
210.7506841057913,
|
210.2448888647705,
|
||||||
0,
|
0,
|
||||||
0,
|
0,
|
||||||
0,
|
0,
|
||||||
|
Loading…
Reference in New Issue
Block a user