From 3148121f1fcb0ad56213b93a643b4b1c74346cd1 Mon Sep 17 00:00:00 2001 From: Jason Felds Date: Mon, 21 May 2012 18:28:15 -0400 Subject: [PATCH] Hack: stop lua error and crash on "fixing". v can't be concatenated: it's a boolean. Anyone more versed in lua want to take a look? --- .../_fallback/Scripts/05 ScoringEngine2.lua | 46 ++++++++++--------- 1 file changed, 24 insertions(+), 22 deletions(-) diff --git a/Themes/_fallback/Scripts/05 ScoringEngine2.lua b/Themes/_fallback/Scripts/05 ScoringEngine2.lua index 4519d6ef2c..5197aa128d 100644 --- a/Themes/_fallback/Scripts/05 ScoringEngine2.lua +++ b/Themes/_fallback/Scripts/05 ScoringEngine2.lua @@ -48,29 +48,31 @@ function InitScoreKeepers(p1Mode, p2Mode) for k,v in pairs(intab) do if not ScoringModes[v] then --SPOILER: UndocumentedFeature crashes the game intentionally. - UndocumentedFeature(k.."'s scoring mode \""..v.."\" doesn't exist.") - end - ReadiedScoreKeepers[k] = coroutine.create(ScoringModes[v]) - --call each scoring mode one time in init mode - checks={coroutine.resume(ReadiedScoreKeepers[k],nil,STATSMAN:GetCurStageStats():GetPlayerStageStats("PlayerNumber_"..k), "PlayerNumber_"..k, "init")} - if not CoroutineIsGood(ReadiedScoreKeepers[k]) then SCREENMAN:SystemMessage("scoring init error: "..checks[2]) return false end - --very very very very safe filtering rule load code - if type(checks[2])=="table" then - if type(checks[2][1])..type(checks[2][2]) == "tabletable" then - local isGood=false - local tapscan = Enum.Reverse(TapNoteScore) - local holdscan = Enum.Reverse(HoldNoteScore) - local finaltable = {{},{}} - for i=1,2 do - for k,v in pairs(checks[2][i]) do - finaltable[i][v]=true - if (not (i==2 and holdscan[v] or tapscan[v])) or v==nil then isGood=false break end - isGood=true + -- UndocumentedFeature(k.."'s scoring mode \""..v.."\" doesn't exist.") + -- UndocumentedFeature(k.."'s scoring mode doesn't exist.") + else + ReadiedScoreKeepers[k] = coroutine.create(ScoringModes[v]) + --call each scoring mode one time in init mode + checks={coroutine.resume(ReadiedScoreKeepers[k],nil,STATSMAN:GetCurStageStats():GetPlayerStageStats("PlayerNumber_"..k), "PlayerNumber_"..k, "init")} + if not CoroutineIsGood(ReadiedScoreKeepers[k]) then SCREENMAN:SystemMessage("scoring init error: "..checks[2]) return false end + --very very very very safe filtering rule load code + if type(checks[2])=="table" then + if type(checks[2][1])..type(checks[2][2]) == "tabletable" then + local isGood=false + local tapscan = Enum.Reverse(TapNoteScore) + local holdscan = Enum.Reverse(HoldNoteScore) + local finaltable = {{},{}} + for i=1,2 do + for k,v in pairs(checks[2][i]) do + finaltable[i][v]=true + if (not (i==2 and holdscan[v] or tapscan[v])) or v==nil then isGood=false break end + isGood=true + end + if not isGood then break end + end + if isGood then + JudgmentFilters[k]=finaltable end - if not isGood then break end - end - if isGood then - JudgmentFilters[k]=finaltable end end end