Skip to content

Commit

Permalink
Fixed two game breaking bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
EliteAsian123 committed May 6, 2023
1 parent 76b93c5 commit 33a5ebf
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
3 changes: 1 addition & 2 deletions Assets/Script/Data/SongInfo.Sources.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ public partial class SongInfo {
{ "rb3dlc", "Rock Band 3 DLC" },
{ "rb4_dlc", "Rock Band 4 DLC" },
{ "rb4dlc", "Rock Band 4 DLC" },
{ "rb4_dlc", "Rock Band 4 DLC" },
{ "rb4_rivals", "Rock Band Rivals" },
{ "rbtp_acdc", "Rock Band Track Pack: AC/DC Live" },
{ "rbtp_classic_rock", "Rock Band Track Pack: Classic Rock" },
Expand Down Expand Up @@ -192,7 +191,7 @@ private static string SourceToGameName(string source) {
if (source is null) {
return "Unknown Source";
}

if (SongLibrary.SourceNames != null && SongLibrary.SourceNames.TryGetValue(source, out string name)) {
return name;
}
Expand Down
11 changes: 7 additions & 4 deletions Assets/Script/UI/AddPlayer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -217,14 +217,17 @@ private string GetDebounceText(long debounce)
=> debounce >= ControlBinding.DEBOUNCE_MINIMUM ? debounce.ToString() : null;

private void StartBind() {
if (inputStrategy.Mappings.Count < 1 || botMode) {
// Skip in certain conditions
if (inputStrategy.Mappings.Count < 1 || botMode ||
selectedDevice?.micIndex != InputStrategy.INVALID_MIC_INDEX) {

DoneBind();
return;
}

var device = selectedDevice?.device;
if (device == null) {
Debug.Assert(false, "No device selected when binding!");
Debug.LogError("No device selected when binding!");
return;
}

Expand Down Expand Up @@ -302,8 +305,8 @@ private void StartBind() {
// Only controls that have changed | Constantly-changing controls like accelerometers | Non-physical controls like stick up/down/left/right
var flags = Enumerate.IgnoreControlsInCurrentState | Enumerate.IncludeNoisyControls | Enumerate.IncludeSyntheticControls;
var activeControls = from control in eventPtr.EnumerateControls(flags, device)
where ControlAllowedAndActive(control, eventPtr)
select control as InputControl<float>;
where ControlAllowedAndActive(control, eventPtr)
select control as InputControl<float>;

if (activeControls != null) {
foreach (var ctrl in activeControls) {
Expand Down

0 comments on commit 33a5ebf

Please sign in to comment.