From a48a5b73ad556175551462036c990e4f5790abaf Mon Sep 17 00:00:00 2001
From: teejusb <5017202+teejusb@users.noreply.github.com>
Date: Wed, 5 Jan 2022 18:21:28 -0800
Subject: [PATCH] Remove returned timing window table
---
Docs/Luadoc/LuaDocumentation.xml | 5 ++---
src/PlayerAI.cpp | 26 +++++++++++---------------
src/PlayerOptions.cpp | 10 ----------
3 files changed, 13 insertions(+), 28 deletions(-)
diff --git a/Docs/Luadoc/LuaDocumentation.xml b/Docs/Luadoc/LuaDocumentation.xml
index 5d8a2c28dc..65ebc05efd 100644
--- a/Docs/Luadoc/LuaDocumentation.xml
+++ b/Docs/Luadoc/LuaDocumentation.xml
@@ -3915,10 +3915,9 @@ a,b = options:Boost(5)
-
+
Selectively disable specific timing windows for a player.
- Valid values are W1 to W5 as defined in the enum.
- Returns a table of TimingWindow with the set of disabled windows after the function call.
+ Valid values are W1 to W5 as defined in the enum.
If the player is using Distant (zero skew and positive tilt), returns the value of tilt and its approach_speed.
diff --git a/src/PlayerAI.cpp b/src/PlayerAI.cpp
index 418f40147b..62ded975d3 100644
--- a/src/PlayerAI.cpp
+++ b/src/PlayerAI.cpp
@@ -144,21 +144,17 @@ TapNoteScore PlayerAI::GetTapNoteScore( const PlayerState* pPlayerState )
TapNoteScore score = distribution.GetTapNoteScore();
const auto& disabledWindows = pPlayerState->m_PlayerOptions.GetCurrent().m_twDisabledWindows;
- for (int i = score; i >= TNS_W5; i--)
- {
- TapNoteScore cur_score = (TapNoteScore)i;
- // Downgrade the TapNoteScore if that specific window is disabled.
- if (cur_score == TNS_W1 && disabledWindows[TW_W1])
- score = TNS_W2;
- if (cur_score == TNS_W2 && disabledWindows[TW_W2])
- score = TNS_W3;
- if (cur_score == TNS_W3 && disabledWindows[TW_W3])
- score = TNS_W4;
- if (cur_score == TNS_W4 && disabledWindows[TW_W4])
- score = TNS_W5;
- if (cur_score == TNS_W5 && disabledWindows[TW_W5])
- score = TNS_None;
- }
+ // Downgrade the TapNoteScore if that specific window is disabled.
+ if (score == TNS_W1 && disabledWindows[TW_W1])
+ score = TNS_W2;
+ if (score == TNS_W2 && disabledWindows[TW_W2])
+ score = TNS_W3;
+ if (score == TNS_W3 && disabledWindows[TW_W3])
+ score = TNS_W4;
+ if (score == TNS_W4 && disabledWindows[TW_W4])
+ score = TNS_W5;
+ if (score == TNS_W5 && disabledWindows[TW_W5])
+ score = TNS_None;
return score;
}
diff --git a/src/PlayerOptions.cpp b/src/PlayerOptions.cpp
index e268d60203..cd54760766 100644
--- a/src/PlayerOptions.cpp
+++ b/src/PlayerOptions.cpp
@@ -2046,16 +2046,6 @@ public:
// Insert the specified TimingWindow into the disabled windows set.
p->m_twDisabledWindows.set(Enum::Check(L, 1));
}
- // Construct a new table indicating all of the disabled windows.
- lua_newtable( L );
- int j = 0;
- for (int i=TW_W1; i != TW_W5; ++i) {
- if (p->m_twDisabledWindows[i]) {
- Enum::Push(L, static_cast(i));
- lua_rawseti( L, -2, j+1 );
- ++j;
- }
- }
OPTIONAL_RETURN_SELF(original_top);
return 1;
}