Пример #1
0
void CClientHandling::SetCollisionDamageMultiplier ( float fMultiplier, bool bRestore )
{ 
    // Set the property
    m_fCollisionDamageMultiplier = fMultiplier;
    m_bCollisionDamageMultiplierChanged = !bRestore; 

    // Loop through the vehicles we're default for
    std::list < eVehicleTypes > ::const_iterator iter = m_DefaultTo.begin ();
    for ( ; iter != m_DefaultTo.end (); iter++ )
    {
        // Grab the handling for this car
        CHandlingEntry* pEntry = g_pGame->GetHandlingManager ()->GetHandlingData ( *iter );
        if ( pEntry )
        {
            // Grab the handlings attached to that car
            std::vector < CClientHandling* > List;
            m_pHandlingManager->GetDefaultHandlings ( *iter, List );

            // Update the property for this vehicle kind
            pEntry->SetCollisionDamageMultiplier ( m_pHandlingManager->GetCollisionDamageMultiplier ( List, *iter ) );
            pEntry->Recalculate ();
        }
    }
}
Пример #2
0
void CClientHandling::SetPercentSubmerged ( unsigned int uiPercent, bool bRestore )
{ 
    // Set the property
    m_uiPercentSubmerged = uiPercent;
    m_bPercentSubmergedChanged = !bRestore; 

    // Loop through the vehicles we're default for
    std::list < eVehicleTypes > ::const_iterator iter = m_DefaultTo.begin ();
    for ( ; iter != m_DefaultTo.end (); iter++ )
    {
        // Grab the handling for this car
        CHandlingEntry* pEntry = g_pGame->GetHandlingManager ()->GetHandlingData ( *iter );
        if ( pEntry )
        {
            // Grab the handlings attached to that car
            std::vector < CClientHandling* > List;
            m_pHandlingManager->GetDefaultHandlings ( *iter, List );

            // Update the property for this vehicle kind
            pEntry->SetPercentSubmerged ( m_pHandlingManager->GetPercentSubmerged ( List, *iter ) );
            pEntry->Recalculate ();
        }
    }
}