Skip to content

Commit 0b25ee9

Browse files
committed
限制最大actionHistory数量
1 parent 1ef6137 commit 0b25ee9

4 files changed

Lines changed: 9 additions & 0 deletions

File tree

assets/game/acryPlayer.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -736,6 +736,7 @@ local baseEnv={
736736
asp=26,
737737

738738
-- Other
739+
maxActionHistory=260,
739740
script=false,
740741

741742
-- May be overrode with user setting

assets/game/basePlayer.lua

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -354,6 +354,9 @@ function P:press(act)
354354

355355
if self.actions[act] and not self.keyState[act] then
356356
self.keyState[act]=true
357+
if #self.actionHistory>=self.settings.maxActionHistory then
358+
rem(self.actionHistory,1)
359+
end
357360
ins(self.actionHistory,{0,self.time,act})
358361
self.actions[act].press(self)
359362
end
@@ -367,6 +370,9 @@ function P:release(act)
367370

368371
if self.actions[act] and self.keyState[act] then
369372
self.keyState[act]=false
373+
if #self.actionHistory>=self.settings.maxActionHistory then
374+
rem(self.actionHistory,1)
375+
end
370376
ins(self.actionHistory,{1,self.time,act})
371377
self.actions[act].release(self)
372378
end

assets/game/brikPlayer.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2063,6 +2063,7 @@ local baseEnv={
20632063
freshLockInASP=true, -- Fresh lockDelay in auto shift period
20642064

20652065
-- Other
2066+
maxActionHistory=260,
20662067
IRSpushUp=true, -- Use bottom-align when IRS or suffocate
20672068
strictLockout=false, -- Lockout causes game over
20682069
script=false,

assets/game/gelaPlayer.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1468,6 +1468,7 @@ local baseEnv={
14681468
freshLockInASP=true,
14691469

14701470
-- Other
1471+
maxActionHistory=260,
14711472
script=false,
14721473
IRSpushUp=true,
14731474
skin='gela_jelly',

0 commit comments

Comments
 (0)