Skip to content

Commit 684d3df

Browse files
authored
Merge branch 'multitheftauto:master' into feature/2dfx
2 parents 03c2b10 + ca877d3 commit 684d3df

File tree

10 files changed

+2345
-1937
lines changed

10 files changed

+2345
-1937
lines changed

Client/core/CSettings.cpp

Lines changed: 27 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -4765,34 +4765,39 @@ static void CPUAffinityQuestionCallBack(void* userdata, unsigned int button)
47654765
{
47664766
CCore::GetSingleton().GetLocalGUI()->GetMainMenu()->GetQuestionWindow()->Reset();
47674767

4768-
if (button == 0)
4769-
{
4770-
auto const checkBox = reinterpret_cast<CGUICheckBox*>(userdata);
4771-
checkBox->SetSelected(false);
4772-
}
4768+
auto* checkbox = static_cast<CGUICheckBox*>(userdata);
4769+
4770+
if (!checkbox)
4771+
return;
4772+
4773+
if (button != 0)
4774+
return;
4775+
4776+
checkbox->SetSelected(true);
47734777
}
47744778

47754779
bool CSettings::OnAffinityClick(CGUIElement* pElement)
47764780
{
4777-
static bool shownWarning = false;
4781+
static bool shown = false;
47784782

4779-
if (m_pProcessAffinityCheckbox->GetSelected() && !shownWarning)
4780-
{
4781-
shownWarning = true;
4783+
if (m_pProcessAffinityCheckbox->GetSelected() || shown)
4784+
return true;
47824785

4783-
std::string message = std::string(
4784-
_("This option should only be changed if you experience performance issues.\n"
4785-
"\nAre you sure you want to enable this option?"));
4786+
shown = true;
47864787

4787-
CQuestionBox* pQuestionBox = CCore::GetSingleton().GetLocalGUI()->GetMainMenu()->GetQuestionWindow();
4788-
pQuestionBox->Reset();
4789-
pQuestionBox->SetTitle(_("EXPERIMENTAL FEATURE"));
4790-
pQuestionBox->SetMessage(message);
4791-
pQuestionBox->SetButton(0, _("No"));
4792-
pQuestionBox->SetButton(1, _("Yes"));
4793-
pQuestionBox->SetCallback(CPUAffinityQuestionCallBack, m_pProcessAffinityCheckbox);
4794-
pQuestionBox->Show();
4795-
}
4788+
std::string title = _("EXPERIMENTAL FEATURE");
4789+
std::string message =
4790+
std::string(_("Disabling this option is not recommended unless you are experiencing performance issues.\n\n"
4791+
"Are you sure you want to disable it?"));
4792+
4793+
CQuestionBox* pQuestionBox = CCore::GetSingleton().GetLocalGUI()->GetMainMenu()->GetQuestionWindow();
4794+
pQuestionBox->Reset();
4795+
pQuestionBox->SetTitle(title);
4796+
pQuestionBox->SetMessage(message);
4797+
pQuestionBox->SetButton(0, _("No"));
4798+
pQuestionBox->SetButton(1, _("Yes"));
4799+
pQuestionBox->SetCallback(CPUAffinityQuestionCallBack, m_pProcessAffinityCheckbox);
4800+
pQuestionBox->Show();
47964801

47974802
return true;
47984803
}
@@ -4961,7 +4966,7 @@ bool CSettings::OnShowAdvancedSettingDescription(CGUIElement* pElement)
49614966
else if (pCheckBox && pCheckBox == m_pWin8MouseCheckBox)
49624967
strText = std::string(_("Mouse fix:")) + " " + std::string(_("Mouse movement fix - May need PC restart"));
49634968
else if (pCheckBox && pCheckBox == m_pProcessAffinityCheckbox)
4964-
strText = std::string(_("CPU affinity:")) + " " + std::string(_("Experimental feature - Change only if you experience performance issues"));
4969+
strText = std::string(_("CPU affinity:")) + " " + std::string(_("Only change if you're having stability issues."));
49654970

49664971
if (strText != "")
49674972
m_pAdvancedSettingDescriptionLabel->SetText(strText.c_str());

Client/game_sa/CAnimManagerSA.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -874,12 +874,18 @@ const char* CAnimManagerSA::GetGateWayAnimationName() const
874874

875875
bool CAnimManagerSA::IsValidGroup(std::uint32_t uiAnimGroup) const
876876
{
877+
if ((eAnimGroup)uiAnimGroup <= eAnimGroup::ANIM_GROUP_NONE || (eAnimGroup)uiAnimGroup >= eAnimGroup::ANIM_TOTAL_GROUPS)
878+
return false;
879+
877880
const auto pGroup = GetAnimBlendAssoc(uiAnimGroup);
878881
return pGroup && pGroup->IsCreated();
879882
}
880883

881884
bool CAnimManagerSA::IsValidAnim(std::uint32_t uiAnimGroup, std::uint32_t uiAnimID) const
882885
{
886+
if ((eAnimID)uiAnimID <= eAnimID::ANIM_ID_UNDEFINED || (eAnimID)uiAnimID >= eAnimID::ANIM_ID_MAX)
887+
return false;
888+
883889
// We get an animation for the checks
884890
const auto pAnim = GetAnimStaticAssociation((eAnimGroup)uiAnimGroup, (eAnimID)uiAnimID);
885891
if (!pAnim)

Client/mods/deathmatch/logic/CClientPed.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2978,7 +2978,7 @@ void CClientPed::ApplyControllerStateFixes(CControllerState& Current)
29782978
// Check we're not doing any important animations
29792979
eAnimID animId = pAssoc->GetAnimID();
29802980
if (animId == eAnimID::ANIM_ID_WALK || animId == eAnimID::ANIM_ID_RUN || animId == eAnimID::ANIM_ID_IDLE ||
2981-
animId == eAnimID::ANIM_ID_WEAPON_CROUCH || animId == eAnimID::ANIM_ID_STEALTH_AIM)
2981+
animId == eAnimID::ANIM_ID_WEAPON_CROUCH || animId == eAnimID::ANIM_ID_KILL_PARTIAL)
29822982
{
29832983
// Are our knife anims loaded?
29842984
std::unique_ptr<CAnimBlock> pBlock = g_pGame->GetAnimManager()->GetAnimationBlock("KNIFE");

Client/multiplayer_sa/CMultiplayerSA_FixBadAnimId.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ eAnimID _cdecl OnCAnimBlendAssocGroupCopyAnimation_FixBadAnim(eAnimGroup* pAnimG
2121
pMultiplayer->SetLastStaticAnimationPlayed(*pAnimGroup, *pAnimId, *(DWORD*)0xb4ea34);
2222

2323
// Fix #1109: Weapon Fire ancient crash with anim ID 224
24-
if (*pAnimId == eAnimID::ANIM_ID_WEAPON_FIRE && *pAnimGroup != eAnimGroup::ANIM_GROUP_GRENADE)
24+
if (*pAnimId == eAnimID::ANIM_ID_FIRE && *pAnimGroup != eAnimGroup::ANIM_GROUP_GRENADE)
2525
{
2626
if (*pAnimGroup < eAnimGroup::ANIM_GROUP_PYTHON || *pAnimGroup > eAnimGroup::ANIM_GROUP_GOGGLES)
2727
{

Client/multiplayer_sa/CMultiplayerSA_FrameRateFixes.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -602,6 +602,7 @@ static void __declspec(naked) HOOK_CWeapon_Update()
602602
fmul st(0), st(1) // (m_timeToNextShootInMS - CTimer::m_snTimeInMilliseconds) * (timeStep / kOriginalTimeStep)
603603
fadd st(0), ebx // + m_snTimeInMilliseconds
604604
fistp [esi+10h]
605+
fstp st(0)
605606

606607
mov eax, ebx
607608

0 commit comments

Comments
 (0)