Skip to content

Commit 0366e9e

Browse files
authored
Merge branch 'master' into patch-6
2 parents feb981b + 605e16d commit 0366e9e

File tree

50 files changed

+11294
-10392
lines changed

Some content is hidden

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

50 files changed

+11294
-10392
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
- name: Checkout code
1414
uses: actions/checkout@v4
1515
with:
16-
fetch-depth: 0
16+
token: ${{ secrets.POT_CI_PAT }}
1717

1818
- name: Setup Git
1919
run: |
@@ -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/CCore.cpp

Lines changed: 29 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1769,43 +1769,44 @@ void CCore::OnPostColorFilterRender()
17691769

17701770
void CCore::ApplyCoreInitSettings()
17711771
{
1772-
#if (_WIN32_WINNT >= _WIN32_WINNT_LONGHORN) // Windows Vista
1773-
bool bValue;
1774-
CVARS_GET("process_dpi_aware", bValue);
1772+
#if (_WIN32_WINNT >= _WIN32_WINNT_LONGHORN)
1773+
const auto aware = CVARS_GET_VALUE<bool>("process_dpi_aware");
17751774

1776-
if (bValue)
1777-
{
1778-
// Minimum supported client for the function below is Windows Vista
1779-
// See also: https://technet.microsoft.com/en-us/evalcenter/dn469266(v=vs.90)
1775+
if (aware)
17801776
SetProcessDPIAware();
1781-
}
17821777
#endif
17831778

1784-
if (int revision = GetApplicationSettingInt("reset-settings-revision"); revision < 21486)
1785-
{
1786-
// Force users with default skin to the 2023 version by replacing "Default" with "Default 2023".
1787-
// The GUI skin "Default 2023" was introduced in commit 2d9e03324b07e355031ecb3263477477f1a91399.
1788-
std::string currentSkinName;
1789-
CVARS_GET("current_skin", currentSkinName);
1779+
const auto revision = GetApplicationSettingInt("reset-settings-revision");
17901780

1791-
if (currentSkinName == "Default")
1792-
{
1793-
CVARS_SET("current_skin", "Default 2023");
1794-
}
1781+
if (revision >= 21486)
1782+
return;
17951783

1796-
SetApplicationSettingInt("reset-settings-revision", 21486);
1797-
}
1784+
const auto skin = CVARS_GET_VALUE<std::string>("current_skin");
1785+
1786+
if (skin == "Default")
1787+
CVARS_SET("current_skin", "Default 2023");
17981788

1799-
// Set process settings
1800-
HANDLE currProc = GetCurrentProcess();
1789+
SetApplicationSettingInt("reset-settings-revision", 21486);
18011790

1802-
// Process priority
1803-
int PriorityClassList[] = {NORMAL_PRIORITY_CLASS, ABOVE_NORMAL_PRIORITY_CLASS, HIGH_PRIORITY_CLASS};
1804-
SetPriorityClass(currProc, PriorityClassList[CVARS_GET_VALUE<int>("process_priority") % 3]);
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;
1794+
1795+
SetPriorityClass(process, priorities[priority]);
1796+
1797+
const auto affinity = CVARS_GET_VALUE<bool>("process_cpu_affinity");
1798+
1799+
if (!affinity)
1800+
return;
1801+
1802+
DWORD_PTR mask;
1803+
DWORD_PTR sys;
1804+
const auto result = GetProcessAffinityMask(process, &mask, &sys);
1805+
1806+
if (!result)
1807+
return;
18051808

1806-
// Process CPU affinity
1807-
if (CVARS_GET_VALUE<bool>("process_cpu_affinity"))
1808-
SetProcessAffinityMask(currProc, 1 << 0);
1809+
SetProcessAffinityMask(process, mask & ~1);
18091810
}
18101811

18111812
//

Client/core/CSettings.cpp

Lines changed: 28 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3242,17 +3242,23 @@ void CSettings::LoadData()
32423242
CVARS_GET("process_cpu_affinity", bVar);
32433243
m_pProcessAffinityCheckbox->SetSelected(bVar);
32443244

3245-
DWORD_PTR affinityMask = 0;
3246-
if (bVar)
3247-
affinityMask = 1 << 0; // CPU 0 only
3245+
DWORD_PTR mask;
3246+
DWORD_PTR sys;
3247+
3248+
const auto process = GetCurrentProcess();
3249+
const auto result = GetProcessAffinityMask(process, &mask, &sys);
3250+
3251+
if (bVar && result)
3252+
{
3253+
SetProcessAffinityMask(process, mask & ~1);
3254+
}
32483255
else
32493256
{
3250-
SYSTEM_INFO sysInfo;
3251-
GetSystemInfo(&sysInfo);
3257+
SYSTEM_INFO info;
32523258

3253-
affinityMask = (1 << sysInfo.dwNumberOfProcessors) - 1; // All cores (default)
3259+
GetSystemInfo(&info);
3260+
SetProcessAffinityMask(process, (1 << info.dwNumberOfProcessors) - 1);
32543261
}
3255-
SetProcessAffinityMask(GetCurrentProcess(), affinityMask);
32563262

32573263
// Update build type
32583264
CVARS_GET("update_build_type", iVar);
@@ -3651,20 +3657,26 @@ void CSettings::SaveData()
36513657
CScreenShot::SetPhotoSavingInsideDocuments(photoSaving);
36523658

36533659
// Process CPU Affinity
3654-
bool cpuAffinity = m_pProcessAffinityCheckbox->GetSelected();
3655-
CVARS_SET("process_cpu_affinity", cpuAffinity);
3660+
const auto affinity = m_pProcessAffinityCheckbox->GetSelected();
3661+
CVARS_SET("process_cpu_affinity", affinity);
36563662

3657-
DWORD_PTR affinityMask = 0;
3658-
if (cpuAffinity)
3659-
affinityMask = 1 << 0; // CPU 0 only
3663+
DWORD_PTR mask;
3664+
DWORD_PTR sys;
3665+
3666+
const auto process = GetCurrentProcess();
3667+
const auto result = GetProcessAffinityMask(process, &mask, &sys);
3668+
3669+
if (affinity && result)
3670+
{
3671+
SetProcessAffinityMask(process, mask & ~1);
3672+
}
36603673
else
36613674
{
3662-
SYSTEM_INFO sysInfo;
3663-
GetSystemInfo(&sysInfo);
3675+
SYSTEM_INFO info;
36643676

3665-
affinityMask = (1 << sysInfo.dwNumberOfProcessors) - 1; // All cores (default)
3677+
GetSystemInfo(&info);
3678+
SetProcessAffinityMask(process, (1 << info.dwNumberOfProcessors) - 1);
36663679
}
3667-
SetProcessAffinityMask(GetCurrentProcess(), affinityMask);
36683680

36693681
// Debug setting
36703682
if (CGUIListItem* pSelected = m_pDebugSettingCombo->GetSelectedItem())

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;

Server/mods/deathmatch/logic/CGame.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2973,7 +2973,7 @@ void CGame::Packet_Vehicle_InOut(CVehicleInOutPacket& Packet)
29732973
// Grab the ped with the chosen ID
29742974
ElementID PedID = Packet.GetPedID();
29752975
CElement* pPedElement = CElementIDs::GetElement(PedID);
2976-
if (pPedElement && IS_PED(pPedElement) && (pPedElement == pPlayer || !IS_PLAYER(pPedElement)))
2976+
if (pPedElement && IS_PED(pPedElement))
29772977
{
29782978
CPed* pPed = static_cast<CPed*>(pPedElement);
29792979
bool bValidPed = false;

0 commit comments

Comments
 (0)