Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions Generals/Code/GameEngine/Include/Common/BitFlags.h
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,6 @@ class BitFlags
//All argument bits must be set in our bits too in order to return TRUE
Bool testForAll( const BitFlags& that ) const
{
DEBUG_ASSERTCRASH( that.any(), ("BitFlags::testForAll is always true if you ask about zero flags. Did you mean that?") );

BitFlags tmp = *this;
tmp.m_bits.flip();
tmp.m_bits &= that.m_bits;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,11 @@ Bool DieMuxData::isDieApplicable(const Object* obj, const DamageInfo *damageInfo
return false;

// all 'exempt' bits must be clear for us to run.
if( m_exemptStatus.any() && obj->getStatusBits().testForAny( m_exemptStatus ) )
if( !obj->getStatusBits().testForNone( m_exemptStatus ) )
return false;

// all 'required' bits must be set for us to run.
// But only if we have a required status to check
if( m_requiredStatus.any() && !obj->getStatusBits().testForAll( m_requiredStatus ) )
if( !obj->getStatusBits().testForAll( m_requiredStatus ) )
return false;

return true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ Bool UpgradeMux::testUpgradeConditions( const UpgradeMaskType& keyMask ) const
getUpgradeActivationMasks(activation, conflicting);

//Okay, make sure we don't have any conflicting upgrades
if( !keyMask.any() || !keyMask.testForAny( conflicting ) )
if( keyMask.testForNone( conflicting ) )
{
//Make sure we have activation conditions
if( activation.any() )
Expand Down
2 changes: 0 additions & 2 deletions GeneralsMD/Code/GameEngine/Include/Common/BitFlags.h
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,6 @@ class BitFlags
//All argument bits must be set in our bits too in order to return TRUE
Bool testForAll( const BitFlags& that ) const
{
DEBUG_ASSERTCRASH( that.any(), ("BitFlags::testForAll is always true if you ask about zero flags. Did you mean that?") );

BitFlags tmp = *this;
tmp.m_bits.flip();
tmp.m_bits &= that.m_bits;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,11 @@ Bool DieMuxData::isDieApplicable(const Object* obj, const DamageInfo *damageInfo
return false;

// all 'exempt' bits must be clear for us to run.
if( m_exemptStatus.any() && obj->getStatusBits().testForAny( m_exemptStatus ) )
if( !obj->getStatusBits().testForNone( m_exemptStatus ) )
return false;

// all 'required' bits must be set for us to run.
// But only if we have a required status to check
if( m_requiredStatus.any() && !obj->getStatusBits().testForAll( m_requiredStatus ) )
if( !obj->getStatusBits().testForAll( m_requiredStatus ) )
return false;

return true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -327,8 +327,7 @@ Bool StealthUpdate::allowedToStealth( Object *stealthOwner ) const
}

//We need all required status or else we fail
// If we have any requirements
if( data->m_requiredStatus.any() && !self->getStatusBits().testForAll( data->m_requiredStatus ) )
if( !self->getStatusBits().testForAll( data->m_requiredStatus ) )
return FALSE;

//If we have any forbidden statii, then fail
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ Bool UpgradeMux::testUpgradeConditions( const UpgradeMaskType& keyMask ) const
getUpgradeActivationMasks(activation, conflicting);

//Okay, make sure we don't have any conflicting upgrades
if( !keyMask.any() || !keyMask.testForAny( conflicting ) )
if( keyMask.testForNone( conflicting ) )
{
//Make sure we have activation conditions
if( activation.any() )
Expand Down
Loading