From a8a8591221d530dbe53e8fb6c3fd4b24826d4143 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Fri, 24 Oct 2003 05:43:04 +0000 Subject: [PATCH] allow many attacks at once, not limited by inventory size --- stepmania/src/GameState.cpp | 13 ++++++++----- stepmania/src/GameState.h | 3 ++- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/stepmania/src/GameState.cpp b/stepmania/src/GameState.cpp index 2a69cd6bb5..9734103cde 100644 --- a/stepmania/src/GameState.cpp +++ b/stepmania/src/GameState.cpp @@ -147,7 +147,7 @@ void GameState::Update( float fDelta ) m_bActiveAttackEndedThisUpdate[p] = false; - for( int s=0; s 0 ) { @@ -624,18 +624,21 @@ void GameState::LaunchAttack( PlayerNumber target, Attack a ) } // search for an open slot - for( int s=0; sRebuildPlayerOptionsFromActiveAttacks( target ); return; } + + LOG->Warn("Couldn't launch attack '%s' against p%i: no empty attack slots", + a.sModifier.c_str(), target ); } void GameState::RemoveActiveAttacksForPlayer( PlayerNumber pn ) { - for( int s=0; s 0 ) iSum += m_ActiveAttacks[pn][s].level; diff --git a/stepmania/src/GameState.h b/stepmania/src/GameState.h index dcedfcf32f..093a62b144 100644 --- a/stepmania/src/GameState.h +++ b/stepmania/src/GameState.h @@ -175,7 +175,8 @@ public: bool IsBlank() { return sModifier.empty(); } void MakeBlank() { sModifier=""; } }; - Attack m_ActiveAttacks[NUM_PLAYERS][NUM_INVENTORY_SLOTS]; + enum { MAX_SIMULTANEOUS_ATTACKS=16 }; + Attack m_ActiveAttacks[NUM_PLAYERS][MAX_SIMULTANEOUS_ATTACKS]; vector m_TransformsToApply[NUM_PLAYERS]; // used in PLAY_MODE_BATTLE