diff --git a/SilentPatch/Common.cpp b/SilentPatch/Common.cpp index a1fb2e8..11b95cb 100644 --- a/SilentPatch/Common.cpp +++ b/SilentPatch/Common.cpp @@ -3,6 +3,7 @@ #include "Utils/MemoryMgr.h" #include "Utils/Patterns.h" #include "StoredCar.h" +#include "SVF.h" #include @@ -72,7 +73,7 @@ namespace TaxiCoronaFix { CVector pos; pos.x = 0.0f; - if ( vehicle->GetModelIndex() == MI_TAXI ) + if ( SVF::ModelHasFeature( vehicle->GetModelIndex(), SVF::Feature::TAXI_LIGHT ) ) { #if _GTA_III pos.y = -0.25f; diff --git a/SilentPatch/SVF.cpp b/SilentPatch/SVF.cpp index 8f5f5e9..7cfa802 100644 --- a/SilentPatch/SVF.cpp +++ b/SilentPatch/SVF.cpp @@ -9,6 +9,16 @@ namespace SVF Feature GetFeatureFromName( const char* featureName ) { constexpr std::pair< const char*, Feature > features[] = { +#if _GTA_III || _GTA_VC + { "TAXI_LIGHT", Feature::TAXI_LIGHT }, +#endif + +#if _GTA_VC + { "FBI_RANCHER_SIREN", Feature::FBI_RANCHER_SIREN }, + { "FBI_WASHINGTON_SIREN", Feature::FBI_WASHINGTON_SIREN }, + { "VICE_CHEETAH_SIREN", Feature::VICE_CHEETAH_SIREN }, +#endif + #if _GTA_SA { "PHOENIX_FLUTTER", Feature::PHOENIX_FLUTTER }, { "SWEEPER_BRUSHES", Feature::SWEEPER_BRUSHES }, @@ -50,7 +60,14 @@ namespace SVF } static std::multimap > specialVehFeatures = { -#if _GTA_SA +#if _GTA_III + _registerFeatureInternal( 110, Feature::TAXI_LIGHT ), +#elif _GTA_VC + _registerFeatureInternal( 147, Feature::FBI_WASHINGTON_SIREN ), + _registerFeatureInternal( 150, Feature::TAXI_LIGHT ), + _registerFeatureInternal( 220, Feature::FBI_RANCHER_SIREN ), + _registerFeatureInternal( 236, Feature::VICE_CHEETAH_SIREN ), +#elif _GTA_SA _registerFeatureInternal( 432, Feature::RHINO_WHEELS ), _registerFeatureInternal( 511, Feature::EXTRA_AILERONS1 ), _registerFeatureInternal( 513, Feature::EXTRA_AILERONS2 ), diff --git a/SilentPatch/SVF.h b/SilentPatch/SVF.h index 147dd0d..138849f 100644 --- a/SilentPatch/SVF.h +++ b/SilentPatch/SVF.h @@ -8,6 +8,16 @@ namespace SVF { NO_FEATURE, +#if _GTA_III || _GTA_VC + TAXI_LIGHT, // Corrected light placement for Taxi +#endif + +#if _GTA_VC + FBI_RANCHER_SIREN, + FBI_WASHINGTON_SIREN, + VICE_CHEETAH_SIREN, +#endif + #if _GTA_SA // Those are fully controlled by SilentPatch PHOENIX_FLUTTER, diff --git a/SilentPatchIII/SilentPatchIII.vcxproj b/SilentPatchIII/SilentPatchIII.vcxproj index 316e48b..e7ac105 100644 --- a/SilentPatchIII/SilentPatchIII.vcxproj +++ b/SilentPatchIII/SilentPatchIII.vcxproj @@ -31,6 +31,11 @@ NotUsing + + NotUsing + NotUsing + NotUsing + NotUsing @@ -53,6 +58,7 @@ + diff --git a/SilentPatchIII/SilentPatchIII.vcxproj.filters b/SilentPatchIII/SilentPatchIII.vcxproj.filters index f24c11e..6170b0e 100644 --- a/SilentPatchIII/SilentPatchIII.vcxproj.filters +++ b/SilentPatchIII/SilentPatchIII.vcxproj.filters @@ -48,6 +48,9 @@ Source Files + + Source Files + @@ -89,6 +92,9 @@ Header Files + + Header Files + diff --git a/SilentPatchIII/VehicleIII.h b/SilentPatchIII/VehicleIII.h index 3088207..6b0dbad 100644 --- a/SilentPatchIII/VehicleIII.h +++ b/SilentPatchIII/VehicleIII.h @@ -12,8 +12,6 @@ enum eVehicleType VEHICLE_PLANE }; -constexpr uint16_t MI_TAXI = 110; - class CVehicle { protected: diff --git a/SilentPatchVC/SilentPatchVC.cpp b/SilentPatchVC/SilentPatchVC.cpp index 6ed21e5..ef74c7d 100644 --- a/SilentPatchVC/SilentPatchVC.cpp +++ b/SilentPatchVC/SilentPatchVC.cpp @@ -7,6 +7,7 @@ #include "Common_ddraw.h" #include "ModelInfoVC.h" #include "VehicleVC.h" +#include "SVF.h" #include #include @@ -390,16 +391,23 @@ namespace FBISirenCoronaFix // False - display siren bool SetUpFBISiren( const CVehicle* vehicle ) { - const int32_t modelIndex = vehicle->GetModelIndex(); - if ( modelIndex == MI_FBICAR || modelIndex == MI_FBIRANCH || modelIndex == MI_VICECHEE ) + SVF::Feature foundFeature = SVF::Feature::NO_FEATURE; + SVF::ForAllModelFeatures( vehicle->GetModelIndex(), [&]( SVF::Feature f ) { + if ( f >= SVF::Feature::FBI_RANCHER_SIREN && f <= SVF::Feature::VICE_CHEETAH_SIREN ) + { + foundFeature = f; + } + } ); + + if ( foundFeature != SVF::Feature::NO_FEATURE ) { - if ( modelIndex == MI_FBICAR || modelIndex == MI_FBIRANCH ) + if ( foundFeature != SVF::Feature::VICE_CHEETAH_SIREN ) { const CVector FBICAR_SIREN_POS = CVector(0.4f, 0.8f, 0.25f); const CVector FBIRANCH_SIREN_POS = CVector(0.5f, 1.12f, 0.5f); overridePosition = true; - vecOverridePosition = modelIndex == MI_FBICAR ? FBICAR_SIREN_POS : FBIRANCH_SIREN_POS; + vecOverridePosition = foundFeature == SVF::Feature::FBI_WASHINGTON_SIREN ? FBICAR_SIREN_POS : FBIRANCH_SIREN_POS; } else { diff --git a/SilentPatchVC/SilentPatchVC.vcxproj b/SilentPatchVC/SilentPatchVC.vcxproj index b08a458..72b1ba6 100644 --- a/SilentPatchVC/SilentPatchVC.vcxproj +++ b/SilentPatchVC/SilentPatchVC.vcxproj @@ -177,6 +177,7 @@ + @@ -201,6 +202,11 @@ NotUsing + + NotUsing + NotUsing + NotUsing + NotUsing diff --git a/SilentPatchVC/SilentPatchVC.vcxproj.filters b/SilentPatchVC/SilentPatchVC.vcxproj.filters index d855db8..e116df4 100644 --- a/SilentPatchVC/SilentPatchVC.vcxproj.filters +++ b/SilentPatchVC/SilentPatchVC.vcxproj.filters @@ -57,6 +57,9 @@ Header Files + + Header Files + @@ -86,6 +89,9 @@ Source Files + + Source Files + diff --git a/SilentPatchVC/VehicleVC.h b/SilentPatchVC/VehicleVC.h index e3c39bf..0cf5fab 100644 --- a/SilentPatchVC/VehicleVC.h +++ b/SilentPatchVC/VehicleVC.h @@ -13,11 +13,6 @@ enum eVehicleType VEHICLE_BIKE }; -constexpr uint16_t MI_FBICAR = 147; -constexpr uint16_t MI_TAXI = 150; -constexpr uint16_t MI_FBIRANCH = 220; -constexpr uint16_t MI_VICECHEE = 236; - class CVehicle { protected: