Skip to content

Commit 9d6999e

Browse files
authored
Merge pull request #2541 from NeatUnsou/develop
fix: Attachedchar input buffer is no longer written to the replay file
2 parents 68c16e0 + 52c207d commit 9d6999e

3 files changed

Lines changed: 14 additions & 8 deletions

File tree

external/script/start.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4146,7 +4146,7 @@ function start.f_stageMusic()
41464146
didLoadStageBGM = false
41474147
end
41484148
-- bgmusic / bgmusic.roundX / bgmusic.final
4149-
if (stagetime() > 0 and not didLoadStageBGM) then
4149+
if (stagetime() > 0 and not didLoadStageBGM and roundstate() <= 2) then
41504150
-- only if the round is not restarted
41514151
if start.bgmround ~= roundno() then
41524152
start.bgmround = roundno()

src/char.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9978,8 +9978,9 @@ func (c *Char) tick() {
99789978
c.selfState(5050, -1, -1, -1, "")
99799979
c.gethitBindClear()
99809980
} else if !bt.pause() {
9981-
// c.bindTime -= 1
9982-
c.setBindTime(c.bindTime - 1)
9981+
//setBindTime is not used here because the CSF_destroy flag may be enabled in a frame with BindTime=0. If bindTime becomes 0, the setBindTime processing will be performed later
9982+
c.bindTime -= 1
9983+
//c.setBindTime(c.bindTime - 1)
99839984
}
99849985
} else {
99859986
if !c.pause() {

src/input.go

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1364,8 +1364,8 @@ func (nc *NetConnection) Update() bool {
13641364
nc.buf[nc.locIn].curT = nc.time
13651365
nc.buf[nc.remIn].curT = nc.time
13661366
if nc.rep != nil {
1367-
for _, nb := range nc.buf {
1368-
binary.Write(nc.rep, binary.LittleEndian, &nb.buf[nc.time&31])
1367+
for i := 0; i < MaxSimul*2; i++ {
1368+
binary.Write(nc.rep, binary.LittleEndian, &nc.buf[i].buf[nc.time&31])
13691369
}
13701370
}
13711371
nc.time++
@@ -1437,9 +1437,14 @@ func (rf *ReplayFile) Update() bool {
14371437
if rf.f == nil {
14381438
sys.esc = true
14391439
} else {
1440-
if sys.oldNextAddTime > 0 &&
1441-
binary.Read(rf.f, binary.LittleEndian, rf.ibit[:]) != nil {
1442-
sys.esc = true
1440+
if sys.oldNextAddTime > 0 {
1441+
for i := range rf.ibit {
1442+
rf.ibit[i] = 0
1443+
}
1444+
err := binary.Read(rf.f, binary.LittleEndian, rf.ibit[:MaxSimul*2])
1445+
if err != nil {
1446+
sys.esc = true
1447+
}
14431448
}
14441449
if sys.esc {
14451450
rf.Close()

0 commit comments

Comments
 (0)