fix ActiveAttackList doesn't show Attacks that started at the very beginning of a Course
This commit is contained in:
@@ -18,14 +18,19 @@ void ActiveAttackList::Init( PlayerNumber pn )
|
|||||||
|
|
||||||
void ActiveAttackList::Update( float fDelta )
|
void ActiveAttackList::Update( float fDelta )
|
||||||
{
|
{
|
||||||
BitmapText::Update( fDelta );
|
bool bTimeToRefresh =
|
||||||
|
IsFirstUpdate() || // check this before running Actor::Update()
|
||||||
bool bTimeToUpdate =
|
|
||||||
GAMESTATE->m_bAttackBeganThisUpdate[m_PlayerNumber] ||
|
GAMESTATE->m_bAttackBeganThisUpdate[m_PlayerNumber] ||
|
||||||
GAMESTATE->m_bAttackEndedThisUpdate[m_PlayerNumber];
|
GAMESTATE->m_bAttackEndedThisUpdate[m_PlayerNumber];
|
||||||
|
|
||||||
if( bTimeToUpdate )
|
BitmapText::Update( fDelta );
|
||||||
{
|
|
||||||
|
if( bTimeToRefresh )
|
||||||
|
Refresh();
|
||||||
|
}
|
||||||
|
|
||||||
|
void ActiveAttackList::Refresh()
|
||||||
|
{
|
||||||
CString s;
|
CString s;
|
||||||
|
|
||||||
const AttackArray& attacks = GAMESTATE->m_ActiveAttacks[m_PlayerNumber]; // NUM_INVENTORY_SLOTS
|
const AttackArray& attacks = GAMESTATE->m_ActiveAttacks[m_PlayerNumber]; // NUM_INVENTORY_SLOTS
|
||||||
@@ -57,7 +62,6 @@ void ActiveAttackList::Update( float fDelta )
|
|||||||
}
|
}
|
||||||
|
|
||||||
this->SetText( s ); // BitmapText will not rebuild vertices if these strings are the same.
|
this->SetText( s ); // BitmapText will not rebuild vertices if these strings are the same.
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ public:
|
|||||||
virtual void Update( float fDelta );
|
virtual void Update( float fDelta );
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
void Refresh();
|
||||||
|
|
||||||
PlayerNumber m_PlayerNumber;
|
PlayerNumber m_PlayerNumber;
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user