Skip to content

Commit

Permalink
Merge branch 'master' into serverlist-new-conf
Browse files Browse the repository at this point in the history
  • Loading branch information
Fernando-A-Rocha authored Oct 3, 2024
2 parents f8b08f5 + f968363 commit 13ff349
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 37 deletions.
1 change: 1 addition & 0 deletions Client/game_sa/CPedSA.h
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,7 @@ class CPedSAInterface : public CPhysicalSAInterface // +1420 = curre
BYTE bCurrentWeaponSlot; // is actually here
BYTE bPad6[3];
CEntitySAInterface* pTargetedObject;
BYTE tempPad[13];
BYTE bFightingStyle; // 1837
BYTE bFightingStyleExtra;
BYTE bPad7[1];
Expand Down
73 changes: 38 additions & 35 deletions Client/game_sa/CVehicleSA.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -684,6 +684,17 @@ void CVehicleSA::RemoveVehicleUpgrade(DWORD dwModelID)
push dwModelID
call dwFunc
}

// GTA SA only does this when CVehicle::ClearVehicleUpgradeFlags returns false.
// In the case of hydraulics and nitro, this function does not return false and the upgrade is never removed from the array
for (std::int16_t& upgrade : GetVehicleInterface()->m_upgrades)
{
if (upgrade == dwModelID)
{
upgrade = -1;
break;
}
}
}

bool CVehicleSA::DoesSupportUpgrade(const SString& strFrameName)
Expand Down Expand Up @@ -1322,49 +1333,41 @@ void CVehicleSA::RecalculateHandling()
// Put it in our interface
CVehicleSAInterface* pInt = GetVehicleInterface();
unsigned int uiHandlingFlags = m_pHandlingData->GetInterface()->uiHandlingFlags;
// user error correction - NOS_INST = NOS Installed t/f
// if nos is installed we need the flag set
if (pInt->m_upgrades[0] && pInt->m_upgrades[0] >= 1008 && pInt->m_upgrades[0] <= 1010)
bool hydralicsInstalled = false, nitroInstalled = false;

// We check whether the user has not set incorrect flags via handlingFlags in the case of nitro and hydraulics
// If this happened, we need to correct it
for (const std::int16_t& upgradeID : pInt->m_upgrades)
{
// Flag not enabled?
if (uiHandlingFlags | HANDLING_NOS_Flag)
// Empty upgrades value is -1
if (upgradeID < 0)
continue;

// If NOS is installed we need set the flag
if ((upgradeID >= 1008 && upgradeID <= 1010) && !(uiHandlingFlags & HANDLING_NOS_Flag))
{
// Set zee flag
uiHandlingFlags |= HANDLING_NOS_Flag;
m_pHandlingData->SetHandlingFlags(uiHandlingFlags);
}
}
else
{
// Flag Enabled?
if (uiHandlingFlags & HANDLING_NOS_Flag)
{
// Unset the flag
uiHandlingFlags &= ~HANDLING_NOS_Flag;
m_pHandlingData->SetHandlingFlags(uiHandlingFlags);
nitroInstalled = true;
}
}
// Hydraulics Flag fixing
if (pInt->m_upgrades[1] && pInt->m_upgrades[1] == 1087)
{
// Flag not enabled?
if (uiHandlingFlags | HANDLING_Hydraulics_Flag)

// If hydraulics is installed we need set the flag
if ((upgradeID == 1087) && !(uiHandlingFlags & HANDLING_Hydraulics_Flag))
{
// Set zee flag
uiHandlingFlags |= HANDLING_Hydraulics_Flag;
m_pHandlingData->SetHandlingFlags(uiHandlingFlags);
}
}
else
{
// Flag Enabled?
if (uiHandlingFlags & HANDLING_Hydraulics_Flag)
{
// Unset the flag
uiHandlingFlags &= ~HANDLING_Hydraulics_Flag;
m_pHandlingData->SetHandlingFlags(uiHandlingFlags);
hydralicsInstalled = true;
}
}

// If hydraulics isn't installed we need unset the flag
if ((!hydralicsInstalled) && (uiHandlingFlags & HANDLING_Hydraulics_Flag))
uiHandlingFlags &= ~HANDLING_Hydraulics_Flag;

// If NOS isn't installed we need unset the flag
if ((!nitroInstalled) && (uiHandlingFlags & HANDLING_NOS_Flag))
uiHandlingFlags &= ~HANDLING_NOS_Flag;

m_pHandlingData->SetHandlingFlags(uiHandlingFlags);

pInt->dwHandlingFlags = uiHandlingFlags;
pInt->m_fMass = m_pHandlingData->GetInterface()->fMass;
pInt->m_fTurnMass = m_pHandlingData->GetInterface()->fTurnMass; // * pGame->GetHandlingManager()->GetTurnMassMultiplier();
Expand Down
4 changes: 2 additions & 2 deletions utils/buildactions/install_cef.lua
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ local CEF_URL_PREFIX = "https://cef-builds.spotifycdn.com/cef_binary_"
local CEF_URL_SUFFIX = "_windows32_minimal.tar.bz2"

-- Change here to update CEF version
local CEF_VERSION = "129.0.6+ga918aa7+chromium-129.0.6668.29"
local CEF_HASH = "989b267d6c2eed6feed4ef304664763612619f1d4ca7f21d95a524c139870d36"
local CEF_VERSION = "129.0.11+g57354b8+chromium-129.0.6668.90"
local CEF_HASH = "a3e3e7add2235d1865a8570522ff87dba392e7b2d15bca0983ed2ebe19ea048b"

function make_cef_download_url()
return CEF_URL_PREFIX..http.escapeUrlParam(CEF_VERSION)..CEF_URL_SUFFIX
Expand Down

0 comments on commit 13ff349

Please sign in to comment.