Skip to content

Commit 74ebac3

Browse files
committed
Merge remote-tracking branch 'upstream/master' into feature/add-new-cj-clothes
2 parents 912f284 + 367eb06 commit 74ebac3

File tree

56 files changed

+11780
-10642
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+11780
-10642
lines changed

.github/workflows/crowdin-auto-merge.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,4 @@ jobs:
2828
git push origin --delete l10n/master
2929
fi
3030
env:
31-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
31+
GITHUB_TOKEN: ${{ secrets.POT_CI_PAT }}

Client/core/CClientVariables.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,7 @@ void CClientVariables::LoadDefaults()
357357
DEFAULT("discord_rpc_share_data", false); // Consistent Rich Presence data sharing
358358
DEFAULT("discord_rpc_share_data_firsttime", false); // Display the user data sharing consent dialog box - for the first time
359359
DEFAULT("browser_enable_gpu", true); // Enable GPU in CEF? (allows stuff like WebGL to function)
360-
DEFAULT("process_cpu_affinity", false); // Set CPU 0 affinity to improve game performance and fix the known issue in single-threaded games
360+
DEFAULT("process_cpu_affinity", true); // Set CPU 0 affinity to improve game performance and fix the known issue in single-threaded games
361361

362362
if (!Exists("locale"))
363363
{

Client/core/CCore.cpp

Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1770,43 +1770,44 @@ void CCore::OnPostColorFilterRender()
17701770
void CCore::ApplyCoreInitSettings()
17711771
{
17721772
#if (_WIN32_WINNT >= _WIN32_WINNT_LONGHORN)
1773-
const auto aware = CVARS_GET_VALUE<bool>("process_dpi_aware");
1773+
bool aware = CVARS_GET_VALUE<bool>("process_dpi_aware");
17741774

1775+
// The minimum supported client for the function below is Windows Vista (Longhorn).
1776+
// For more information, refer to the Microsoft Learn article:
1777+
// https://learn.microsoft.com/en-us/windows/win32/hidpi/high-dpi-desktop-application-development-on-windows
17751778
if (aware)
17761779
SetProcessDPIAware();
17771780
#endif
17781781

1779-
const auto revision = GetApplicationSettingInt("reset-settings-revision");
1782+
int revision = GetApplicationSettingInt("reset-settings-revision");
17801783

1781-
if (revision >= 21486)
1782-
return;
1783-
1784-
const auto skin = CVARS_GET_VALUE<std::string>("current_skin");
1784+
// Users with the default skin will be switched to the 2023 version by replacing "Default" with "Default 2023".
1785+
// The "Default 2023" GUI skin was introduced in commit 2d9e03324b07e355031ecb3263477477f1a91399.
1786+
if (revision < 21486)
1787+
{
1788+
auto skin = CVARS_GET_VALUE<std::string>("current_skin");
17851789

1786-
if (skin == "Default")
1787-
CVARS_SET("current_skin", "Default 2023");
1790+
if (skin == "Default")
1791+
CVARS_SET("current_skin", "Default 2023");
17881792

1789-
SetApplicationSettingInt("reset-settings-revision", 21486);
1793+
SetApplicationSettingInt("reset-settings-revision", 21486);
1794+
}
17901795

1791-
const auto process = GetCurrentProcess();
1792-
const int priorities[] = {NORMAL_PRIORITY_CLASS, ABOVE_NORMAL_PRIORITY_CLASS, HIGH_PRIORITY_CLASS};
1793-
const auto priority = CVARS_GET_VALUE<int>("process_priority") % 3;
1796+
HANDLE process = GetCurrentProcess();
1797+
const int priorities[] = {NORMAL_PRIORITY_CLASS, ABOVE_NORMAL_PRIORITY_CLASS, HIGH_PRIORITY_CLASS};
1798+
int priority = CVARS_GET_VALUE<int>("process_priority") % 3;
17941799

17951800
SetPriorityClass(process, priorities[priority]);
17961801

1797-
const auto affinity = CVARS_GET_VALUE<bool>("process_cpu_affinity");
1798-
1802+
bool affinity = CVARS_GET_VALUE<bool>("process_cpu_affinity");
17991803
if (!affinity)
18001804
return;
18011805

18021806
DWORD_PTR mask;
18031807
DWORD_PTR sys;
1804-
const auto result = GetProcessAffinityMask(process, &mask, &sys);
1805-
1806-
if (!result)
1807-
return;
1808-
1809-
SetProcessAffinityMask(process, mask & ~1);
1808+
BOOL result = GetProcessAffinityMask(process, &mask, &sys);
1809+
if (result)
1810+
SetProcessAffinityMask(process, mask & ~1);
18101811
}
18111812

18121813
//

Client/core/CSettings.cpp

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3245,13 +3245,11 @@ void CSettings::LoadData()
32453245
DWORD_PTR mask;
32463246
DWORD_PTR sys;
32473247

3248-
const auto process = GetCurrentProcess();
3249-
const auto result = GetProcessAffinityMask(process, &mask, &sys);
3248+
HANDLE process = GetCurrentProcess();
3249+
BOOL result = GetProcessAffinityMask(process, &mask, &sys);
32503250

32513251
if (bVar && result)
3252-
{
32533252
SetProcessAffinityMask(process, mask & ~1);
3254-
}
32553253
else
32563254
{
32573255
SYSTEM_INFO info;
@@ -3657,19 +3655,17 @@ void CSettings::SaveData()
36573655
CScreenShot::SetPhotoSavingInsideDocuments(photoSaving);
36583656

36593657
// Process CPU Affinity
3660-
const auto affinity = m_pProcessAffinityCheckbox->GetSelected();
3658+
bool affinity = m_pProcessAffinityCheckbox->GetSelected();
36613659
CVARS_SET("process_cpu_affinity", affinity);
36623660

36633661
DWORD_PTR mask;
36643662
DWORD_PTR sys;
36653663

3666-
const auto process = GetCurrentProcess();
3667-
const auto result = GetProcessAffinityMask(process, &mask, &sys);
3664+
HANDLE process = GetCurrentProcess();
3665+
BOOL result = GetProcessAffinityMask(process, &mask, &sys);
36683666

36693667
if (affinity && result)
3670-
{
36713668
SetProcessAffinityMask(process, mask & ~1);
3672-
}
36733669
else
36743670
{
36753671
SYSTEM_INFO info;
@@ -4785,9 +4781,7 @@ bool CSettings::OnAffinityClick(CGUIElement* pElement)
47854781
shownWarning = true;
47864782

47874783
std::string message = std::string(
4788-
_("Enabling this setting may improve game performance, but on some processors, it may worsen it.\n"
4789-
"We have observed issues with AMD Ryzen processors featuring 3D V-Cache.\n"
4790-
"The exact list of affected processors is unknown.\n"
4784+
_("This option should only be changed if you experience performance issues.\n"
47914785
"\nAre you sure you want to enable this option?"));
47924786

47934787
CQuestionBox* pQuestionBox = CCore::GetSingleton().GetLocalGUI()->GetMainMenu()->GetQuestionWindow();
@@ -4967,7 +4961,7 @@ bool CSettings::OnShowAdvancedSettingDescription(CGUIElement* pElement)
49674961
else if (pCheckBox && pCheckBox == m_pWin8MouseCheckBox)
49684962
strText = std::string(_("Mouse fix:")) + " " + std::string(_("Mouse movement fix - May need PC restart"));
49694963
else if (pCheckBox && pCheckBox == m_pProcessAffinityCheckbox)
4970-
strText = std::string(_("CPU affinity:")) + " " + std::string(_("Experimental feature - It may improve performance or worsen it."));
4964+
strText = std::string(_("CPU affinity:")) + " " + std::string(_("Experimental feature - Change only if you experience performance issues"));
49714965

49724966
if (strText != "")
49734967
m_pAdvancedSettingDescriptionLabel->SetText(strText.c_str());

Client/mods/deathmatch/logic/CClientMarker.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -447,7 +447,7 @@ void CClientMarker::CreateOfType(int iType)
447447
CClientCheckpoint* pCheckpoint = new CClientCheckpoint(this);
448448
pCheckpoint->SetCheckpointType(CClientCheckpoint::TYPE_NORMAL);
449449
m_pMarker = pCheckpoint;
450-
m_pCollision = new CClientColCircle(g_pClientGame->GetManager(), NULL, vecOrigin, GetSize());
450+
m_pCollision = new CClientColCircle(g_pClientGame->GetManager(), INVALID_ELEMENT_ID, vecOrigin, GetSize());
451451
m_pCollision->m_pOwningMarker = this;
452452
m_pCollision->SetHitCallback(this);
453453
break;
@@ -458,7 +458,7 @@ void CClientMarker::CreateOfType(int iType)
458458
CClientCheckpoint* pCheckpoint = new CClientCheckpoint(this);
459459
pCheckpoint->SetCheckpointType(CClientCheckpoint::TYPE_RING);
460460
m_pMarker = pCheckpoint;
461-
m_pCollision = new CClientColSphere(g_pClientGame->GetManager(), NULL, vecOrigin, GetSize());
461+
m_pCollision = new CClientColSphere(g_pClientGame->GetManager(), INVALID_ELEMENT_ID, vecOrigin, GetSize());
462462
m_pCollision->m_pOwningMarker = this;
463463
m_pCollision->SetHitCallback(this);
464464
break;
@@ -469,7 +469,7 @@ void CClientMarker::CreateOfType(int iType)
469469
CClient3DMarker* p3DMarker = new CClient3DMarker(this);
470470
p3DMarker->Set3DMarkerType(CClient3DMarker::TYPE_CYLINDER);
471471
m_pMarker = p3DMarker;
472-
m_pCollision = new CClientColCircle(g_pClientGame->GetManager(), NULL, vecOrigin, GetSize());
472+
m_pCollision = new CClientColCircle(g_pClientGame->GetManager(), INVALID_ELEMENT_ID, vecOrigin, GetSize());
473473
m_pCollision->m_pOwningMarker = this;
474474
m_pCollision->SetHitCallback(this);
475475
break;
@@ -480,7 +480,7 @@ void CClientMarker::CreateOfType(int iType)
480480
CClient3DMarker* p3DMarker = new CClient3DMarker(this);
481481
p3DMarker->Set3DMarkerType(CClient3DMarker::TYPE_ARROW);
482482
m_pMarker = p3DMarker;
483-
m_pCollision = new CClientColSphere(g_pClientGame->GetManager(), NULL, vecOrigin, GetSize());
483+
m_pCollision = new CClientColSphere(g_pClientGame->GetManager(), INVALID_ELEMENT_ID, vecOrigin, GetSize());
484484
m_pCollision->m_pOwningMarker = this;
485485
m_pCollision->SetHitCallback(this);
486486
break;
@@ -489,7 +489,7 @@ void CClientMarker::CreateOfType(int iType)
489489
case MARKER_CORONA:
490490
{
491491
m_pMarker = new CClientCorona(this);
492-
m_pCollision = new CClientColSphere(g_pClientGame->GetManager(), NULL, vecOrigin, GetSize());
492+
m_pCollision = new CClientColSphere(g_pClientGame->GetManager(), INVALID_ELEMENT_ID, vecOrigin, GetSize());
493493
m_pCollision->m_pOwningMarker = this;
494494
m_pCollision->SetHitCallback(this);
495495
break;

Client/mods/deathmatch/logic/CClientPed.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1016,12 +1016,12 @@ void CClientPed::SetTargetTarget(unsigned long ulDelay, const CVector& vecSource
10161016
float fRadius = DistanceBetweenPoints3D(m_vecTargetSource, m_vecTargetTarget);
10171017

10181018
// Grab the angle of the source vector and the angle of the target vector relative to the source vector that applies
1019-
m_vecBeginTargetAngle.fX = acos((m_vecBeginTarget.fX - m_vecBeginSource.fX) / fRadius);
1020-
m_vecBeginTargetAngle.fY = acos((m_vecBeginTarget.fY - m_vecBeginSource.fY) / fRadius);
1021-
m_vecBeginTargetAngle.fZ = acos((m_vecBeginTarget.fZ - m_vecBeginSource.fZ) / fRadius);
1022-
m_vecTargetTargetAngle.fX = acos((m_vecTargetTarget.fX - m_vecTargetSource.fX) / fRadius);
1023-
m_vecTargetTargetAngle.fY = acos((m_vecTargetTarget.fY - m_vecTargetSource.fY) / fRadius);
1024-
m_vecTargetTargetAngle.fZ = acos((m_vecTargetTarget.fZ - m_vecTargetSource.fZ) / fRadius);
1019+
m_vecBeginTargetAngle.fX = acos(Clamp(-1.0f, (m_vecBeginTarget.fX - m_vecBeginSource.fX) / fRadius, 1.0f));
1020+
m_vecBeginTargetAngle.fY = acos(Clamp(-1.0f, (m_vecBeginTarget.fY - m_vecBeginSource.fY) / fRadius, 1.0f));
1021+
m_vecBeginTargetAngle.fZ = acos(Clamp(-1.0f, (m_vecBeginTarget.fZ - m_vecBeginSource.fZ) / fRadius, 1.0f));
1022+
m_vecTargetTargetAngle.fX = acos(Clamp(-1.0f, (m_vecTargetTarget.fX - m_vecTargetSource.fX) / fRadius, 1.0f));
1023+
m_vecTargetTargetAngle.fY = acos(Clamp(-1.0f, (m_vecTargetTarget.fY - m_vecTargetSource.fY) / fRadius, 1.0f));
1024+
m_vecTargetTargetAngle.fZ = acos(Clamp(-1.0f, (m_vecTargetTarget.fZ - m_vecTargetSource.fZ) / fRadius, 1.0f));
10251025

10261026
// Grab the angle to interpolate and make sure it's below pi and above -pi (shortest path of interpolation)
10271027
m_vecTargetInterpolateAngle = m_vecTargetTargetAngle - m_vecBeginTargetAngle;

0 commit comments

Comments
 (0)