simplify
This commit is contained in:
@@ -185,14 +185,15 @@ void Inventory::UseItem( int iSlot )
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
PlayerNumber pn = m_pPlayerState->m_PlayerNumber;
|
PlayerNumber pn = m_pPlayerState->m_PlayerNumber;
|
||||||
PlayerNumber pnToAttack = OPPOSITE_PLAYER[pn];
|
|
||||||
Attack a = pInventory[iSlot];
|
Attack a = pInventory[iSlot];
|
||||||
|
|
||||||
// remove the item
|
// remove the item
|
||||||
pInventory[iSlot].MakeBlank();
|
pInventory[iSlot].MakeBlank();
|
||||||
m_vpSoundUseItem[a.level]->Play();
|
m_vpSoundUseItem[a.level]->Play();
|
||||||
|
|
||||||
GAMESTATE->LaunchAttack( (MultiPlayer)pnToAttack, a );
|
PlayerNumber pnToAttack = OPPOSITE_PLAYER[pn];
|
||||||
|
PlayerState *pPlayerStateToAttack = GAMESTATE->m_pPlayerState[pnToAttack];
|
||||||
|
pPlayerStateToAttack->LaunchAttack( a );
|
||||||
|
|
||||||
float fPercentHealthToDrain = (a.level+1) / 10.f;
|
float fPercentHealthToDrain = (a.level+1) / 10.f;
|
||||||
ASSERT( fPercentHealthToDrain > 0 );
|
ASSERT( fPercentHealthToDrain > 0 );
|
||||||
|
|||||||
Reference in New Issue
Block a user