mirror of
https://github.com/CookiePLMonster/SilentPatch.git
synced 2024-11-22 05:22:32 +01:00
III/VC: Made vehicle ID-based fixes data driven
This commit is contained in:
parent
7a96e5eefb
commit
f3f9004322
@ -3,6 +3,7 @@
|
||||
#include "Utils/MemoryMgr.h"
|
||||
#include "Utils/Patterns.h"
|
||||
#include "StoredCar.h"
|
||||
#include "SVF.h"
|
||||
|
||||
#include <rwcore.h>
|
||||
|
||||
@ -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;
|
||||
|
@ -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<int32_t, std::tuple<Feature, int32_t> > 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 ),
|
||||
|
@ -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,
|
||||
|
@ -31,6 +31,11 @@
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">NotUsing</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\SilentPatch\StoredCar.cpp" />
|
||||
<ClCompile Include="..\SilentPatch\SVF.cpp">
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">NotUsing</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Master|Win32'">NotUsing</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">NotUsing</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\SilentPatch\Timer.cpp" />
|
||||
<ClCompile Include="..\SilentPatch\Utils\Patterns.cpp">
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">NotUsing</PrecompiledHeader>
|
||||
@ -53,6 +58,7 @@
|
||||
<ClInclude Include="..\SilentPatch\RWGTA.h" />
|
||||
<ClInclude Include="..\SilentPatch\StdAfx.h" />
|
||||
<ClInclude Include="..\SilentPatch\StoredCar.h" />
|
||||
<ClInclude Include="..\SilentPatch\SVF.h" />
|
||||
<ClInclude Include="..\SilentPatch\Timer.h" />
|
||||
<ClInclude Include="..\SilentPatch\Utils\MemoryMgr.GTA.h" />
|
||||
<ClInclude Include="..\SilentPatch\Utils\MemoryMgr.h" />
|
||||
|
@ -48,6 +48,9 @@
|
||||
<ClCompile Include="ModelInfoIII.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\SilentPatch\SVF.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\SilentPatch\Timer.h">
|
||||
@ -89,6 +92,9 @@
|
||||
<ClInclude Include="ModelInfoIII.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\SilentPatch\SVF.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="..\SilentPatch\SilentPatch.rc">
|
||||
|
@ -12,8 +12,6 @@ enum eVehicleType
|
||||
VEHICLE_PLANE
|
||||
};
|
||||
|
||||
constexpr uint16_t MI_TAXI = 110;
|
||||
|
||||
class CVehicle
|
||||
{
|
||||
protected:
|
||||
|
@ -7,6 +7,7 @@
|
||||
#include "Common_ddraw.h"
|
||||
#include "ModelInfoVC.h"
|
||||
#include "VehicleVC.h"
|
||||
#include "SVF.h"
|
||||
|
||||
#include <memory>
|
||||
#include <Shlwapi.h>
|
||||
@ -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 )
|
||||
{
|
||||
if ( modelIndex == MI_FBICAR || modelIndex == MI_FBIRANCH )
|
||||
foundFeature = f;
|
||||
}
|
||||
} );
|
||||
|
||||
if ( foundFeature != SVF::Feature::NO_FEATURE )
|
||||
{
|
||||
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
|
||||
{
|
||||
|
@ -177,6 +177,7 @@
|
||||
<ClInclude Include="..\SilentPatch\RWGTA.h" />
|
||||
<ClInclude Include="..\SilentPatch\StdAfx.h" />
|
||||
<ClInclude Include="..\SilentPatch\StoredCar.h" />
|
||||
<ClInclude Include="..\SilentPatch\SVF.h" />
|
||||
<ClInclude Include="..\SilentPatch\Timer.h" />
|
||||
<ClInclude Include="..\SilentPatch\Utils\MemoryMgr.GTA.h" />
|
||||
<ClInclude Include="..\SilentPatch\Utils\MemoryMgr.h" />
|
||||
@ -201,6 +202,11 @@
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">NotUsing</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\SilentPatch\StoredCar.cpp" />
|
||||
<ClCompile Include="..\SilentPatch\SVF.cpp">
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">NotUsing</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Master|Win32'">NotUsing</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">NotUsing</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\SilentPatch\Timer.cpp" />
|
||||
<ClCompile Include="..\SilentPatch\Utils\Patterns.cpp">
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">NotUsing</PrecompiledHeader>
|
||||
|
@ -57,6 +57,9 @@
|
||||
<ClInclude Include="..\SilentPatch\Maths.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\SilentPatch\SVF.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\SilentPatch\Timer.cpp">
|
||||
@ -86,6 +89,9 @@
|
||||
<ClCompile Include="..\SilentPatch\RWGTA.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\SilentPatch\SVF.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="..\SilentPatch\SilentPatch.rc">
|
||||
|
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user