Skip to content

Commit

Permalink
Set player count to 1 and fix gameplay issue stemming from that
Browse files Browse the repository at this point in the history
...Time to kill player 2 once and for all.
  • Loading branch information
poco0317 committed Dec 20, 2018
1 parent 50e168f commit 6525281
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 21 deletions.
15 changes: 2 additions & 13 deletions src/AutoKeysounds.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,15 +113,13 @@ AutoKeysounds::LoadAutoplaySoundsInto(RageSoundReader_Chain* pChain)
void
AutoKeysounds::LoadTracks(const Song* pSong,
RageSoundReader*& pShared,
RageSoundReader*& pPlayer1,
RageSoundReader*& pPlayer2)
RageSoundReader*& pPlayer1)
{
// If we have two players, prefer a three-track sound; otherwise prefer a
// two-track sound.
// bool bTwoPlayers = GAMESTATE->GetNumPlayersEnabled() == 2;

pPlayer1 = nullptr;
pPlayer2 = nullptr;
pShared = nullptr;

vector<RString> vsMusicFile;
Expand Down Expand Up @@ -197,7 +195,7 @@ AutoKeysounds::FinishLoading()
Song* pSong = GAMESTATE->m_pCurSong;

vector<RageSoundReader*> apSounds;
LoadTracks(pSong, m_pSharedSound, m_pPlayerSounds[0], m_pPlayerSounds[1]);
LoadTracks(pSong, m_pSharedSound, m_pPlayerSounds[0]);

// Load autoplay sounds, if any.
{
Expand Down Expand Up @@ -234,15 +232,6 @@ AutoKeysounds::FinishLoading()
apSounds.push_back(m_pPlayerSounds[0]);
}

if (m_pPlayerSounds[1] != nullptr) {
m_pPlayerSounds[1] =
new RageSoundReader_PitchChange(m_pPlayerSounds[1]);
m_pPlayerSounds[1] =
new RageSoundReader_PostBuffering(m_pPlayerSounds[1]);
m_pPlayerSounds[1] = new RageSoundReader_Pan(m_pPlayerSounds[1]);
apSounds.push_back(m_pPlayerSounds[1]);
}

if (apSounds.size() > 1) {
auto* pMerge = new RageSoundReader_Merge;

Expand Down
3 changes: 1 addition & 2 deletions src/AutoKeysounds.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@ class AutoKeysounds
void LoadAutoplaySoundsInto(RageSoundReader_Chain* pChain);
static void LoadTracks(const Song* pSong,
RageSoundReader*& pGlobal,
RageSoundReader*& pPlayer1,
RageSoundReader*& pPlayer2);
RageSoundReader*& pPlayer1);

NoteData m_ndAutoKeysoundsOnly[NUM_PLAYERS];
vector<RageSound> m_vKeysounds;
Expand Down
3 changes: 1 addition & 2 deletions src/PlayerNumber.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
#include "PlayerNumber.h"

static const char* PlayerNumberNames[] = {
"P1",
"P2"
"P1"
};
XToString(PlayerNumber);
XToLocalizedString(PlayerNumber);
Expand Down
7 changes: 3 additions & 4 deletions src/PlayerNumber.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* PlayerNumber - A simple type representing a player. */
/* PlayerNumber - A simple type representing a player. */

#ifndef PlayerNumber_H
#define PlayerNumber_H
Expand All @@ -9,8 +9,7 @@
enum PlayerNumber
{
PLAYER_1 = 0,
PLAYER_2,
NUM_PlayerNumber, // leave this at the end
NUM_PlayerNumber, // leave this at the end
PlayerNumber_Invalid
};
const PlayerNumber NUM_PLAYERS = NUM_PlayerNumber;
Expand All @@ -23,7 +22,7 @@ LuaDeclareType(PlayerNumber);
/** @brief A foreach loop to handle the different players. */
#define FOREACH_PlayerNumber(pn) FOREACH_ENUM(PlayerNumber, pn)

const PlayerNumber OPPOSITE_PLAYER[NUM_PLAYERS] = { PLAYER_1 };
const PlayerNumber OPPOSITE_PLAYER[NUM_PLAYERS] = { PLAYER_1 };

enum MultiPlayer
{
Expand Down

0 comments on commit 6525281

Please sign in to comment.