Skip to content

Commit 01ea98a

Browse files
authored
Merge branch 'multitheftauto:master' into startstop
2 parents ab4da82 + 4d4d6c9 commit 01ea98a

File tree

392 files changed

+52756
-11399
lines changed

Some content is hidden

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

392 files changed

+52756
-11399
lines changed

.github/workflows/codeql.yml

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
# - https://gh.io/supported-runners-and-hardware-resources
2828
# - https://gh.io/using-larger-runners (GitHub.com only)
2929
# Consider using larger runners or machines with greater resources for possible analysis time improvements.
30-
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
30+
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'windows-2025' }}
3131
permissions:
3232
# required for all workflows
3333
security-events: write
@@ -43,13 +43,7 @@ jobs:
4343
fail-fast: false
4444
matrix:
4545
include:
46-
- language: actions
47-
build-mode: none
4846
- language: c-cpp
49-
build-mode: autobuild
50-
- language: javascript-typescript
51-
build-mode: none
52-
- language: python
5347
build-mode: none
5448
# CodeQL supports the following values keywords for 'language': 'actions', 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'rust', 'swift'
5549
# Use `c-cpp` to analyze code written in C, C++ or both

Client/core/CCommandFuncs.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -318,6 +318,10 @@ void CCommandFuncs::Reconnect(const char* szParameters)
318318
// Start the connect
319319
if (CCore::GetSingleton().GetConnectManager()->Reconnect(strHost.c_str(), usPort, strPassword.c_str(), false))
320320
{
321+
if (CCore::GetSingleton().GetConnectManager()->WasQuickConnect())
322+
{
323+
CCore::GetSingleton().GetConnectManager()->SetQuickConnect(false);
324+
}
321325
CCore::GetSingleton().GetConsole()->Printf(_("reconnect: Reconnecting to %s:%u..."), strHost.c_str(), usPort);
322326
}
323327
else

Client/core/CConnectManager.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,14 @@ class CConnectManager
2626

2727
bool Abort();
2828

29+
bool WasQuickConnect() const noexcept { return m_quickConnect; }
30+
2931
void DoPulse();
3032

3133
void OnServerExists();
3234

35+
void SetQuickConnect(bool quick) noexcept { m_quickConnect = quick; }
36+
3337
static void OpenServerFirewall(in_addr Address, ushort usHttpPort = 80, bool bHighPriority = false);
3438

3539
static bool StaticProcessPacket(unsigned char ucPacketID, class NetBitStreamInterface& bitStream);
@@ -59,4 +63,5 @@ class CConnectManager
5963
bool m_bNotifyServerBrowser;
6064

6165
bool CheckNickProvided(const char* szNick);
66+
bool m_quickConnect{false};
6267
};

Client/core/CMainMenu.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -850,6 +850,9 @@ bool CMainMenu::OnMenuClick(CGUIMouseEventArgs Args)
850850
}
851851

852852
break;
853+
case MENU_ITEM_QUICK_CONNECT:
854+
AskUserIfHeWantsToDisconnect(m_pHoveredItem->menuType);
855+
return true;
853856
default:
854857
break;
855858
}
@@ -914,7 +917,8 @@ bool CMainMenu::OnQuickConnectButtonClick(CGUIElement* pElement, bool left)
914917
ShowNetworkNotReadyWindow();
915918
return true;
916919
}
917-
920+
921+
g_pCore->GetConnectManager()->SetQuickConnect(true);
918922
g_pCore->GetCommands()->Execute("reconnect", "");
919923
}
920924
else
@@ -1262,6 +1266,9 @@ void CMainMenu::WantsToDisconnectCallBack(void* pData, uint uiButton)
12621266
case MENU_ITEM_DISCONNECT:
12631267
OnDisconnectButtonClick();
12641268
break;
1269+
case MENU_ITEM_QUICK_CONNECT:
1270+
OnQuickConnectButtonClick(nullptr, true);
1271+
break;
12651272
default:
12661273
break;
12671274
}

Client/core/CSteamClient.cpp

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -377,9 +377,24 @@ bool CSteamClient::Load()
377377
return false;
378378
}
379379

380+
static auto pAddDllDirectory = ([]() -> decltype(&AddDllDirectory) {
381+
if (const HMODULE kernel32 = GetModuleHandleW(L"kernel32.dll"); kernel32 != nullptr)
382+
{
383+
return reinterpret_cast<decltype(&AddDllDirectory)>(static_cast<void*>(GetProcAddress(kernel32, "AddDllDirectory")));
384+
}
385+
386+
return nullptr;
387+
})();
388+
389+
if (pAddDllDirectory == nullptr)
390+
{
391+
WriteErrorEvent("Your operating system is outdated and is missing the KB2533623 update package for AddDllDirectory");
392+
return false;
393+
}
394+
380395
WriteDebugEvent(SString("Using steamclient.dll: %s", *ToUTF8(steamClientPath.value())));
381396
SetEnvironmentVariableW(L"SteamAppId", L"" STEAM_GTASA_APP_ID);
382-
AddDllDirectory(steamDirPath.c_str());
397+
pAddDllDirectory(steamDirPath.c_str());
383398
{
384399
static wchar_t pathBuffer[65536];
385400
GetEnvironmentVariableW(L"PATH", pathBuffer, sizeof(pathBuffer) / sizeof(wchar_t));
@@ -425,7 +440,7 @@ bool CSteamClient::Load()
425440

426441
releaseLibraryLock.reset();
427442

428-
Native::CreateInterface = reinterpret_cast<decltype(Native::CreateInterface)>(GetProcAddress(dll, "CreateInterface"));
443+
Native::CreateInterface = reinterpret_cast<decltype(Native::CreateInterface)>(static_cast<void*>(GetProcAddress(dll, "CreateInterface")));
429444

430445
if (!Native::CreateInterface)
431446
{

Client/core/DXHook/CProxyDirect3DDevice9.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ ULONG CProxyDirect3DDevice9::Release()
117117
// Call event handler
118118
CDirect3DEvents9::OnDirect3DDeviceDestroy(m_pDevice);
119119
delete this;
120+
return ulRefCount - 1;
120121
}
121122

122123
return m_pDevice->Release();

Client/core/Graphics/CRenderItemManager.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ CVectorGraphicItem* CRenderItemManager::CreateVectorGraphic(uint width, uint hei
167167
}
168168

169169
UpdateMemoryUsage();
170-
170+
171171
return pVectorItem;
172172
}
173173

@@ -723,7 +723,7 @@ void CRenderItemManager::UpdateMemoryUsage()
723723
continue;
724724
int iMemoryKBUsed = pRenderItem->GetVideoMemoryKBUsed();
725725

726-
if (pRenderItem->IsA(CFileTextureItem::GetClassId()))
726+
if (pRenderItem->IsA(CFileTextureItem::GetClassId()) || pRenderItem->IsA(CVectorGraphicItem::GetClassId()))
727727
m_iTextureMemoryKBUsed += iMemoryKBUsed;
728728
else if (pRenderItem->IsA(CRenderTargetItem::GetClassId()) || pRenderItem->IsA(CScreenSourceItem::GetClassId()))
729729
m_iRenderTargetMemoryKBUsed += iMemoryKBUsed;

Client/game_sa/CHudSA.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,9 @@ void CHudSA::InitComponentList()
122122
{1, HUD_VEHICLE_NAME, 1, FUNC_DrawVehicleName, 1, 0xCC, 0xC3},
123123
{1, HUD_AREA_NAME, 1, FUNC_DrawAreaName, 1, 0xCC, 0xC3},
124124
{1, HUD_RADAR, 1, FUNC_DrawRadar, 1, 0xCC, 0xC3},
125+
{1, HUD_RADAR_MAP, 1, FUNC_CRadar_DrawMap, 1, 0xCC, 0xC3},
126+
{1, HUD_RADAR_BLIPS, 1, FUNC_CRadar_DrawBlips, 1, 0xCC, 0xC3},
127+
{1, HUD_RADAR_ALTIMETER, 1, CODE_ShowRadarAltimeter, 2, 0xCC, 0xEB30},
125128
{1, HUD_CLOCK, 0, VAR_DisableClock, 1, 1, 0},
126129
{1, HUD_RADIO, 1, FUNC_DrawRadioName, 1, 0xCC, 0xC3},
127130
{1, HUD_WANTED, 1, FUNC_DrawWantedLevel, 1, 0xCC, 0xC3},

Client/game_sa/CHudSA.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,11 @@
4949
#define FUNC_CSprite2d_Draw 0x728350
5050
#define FUNC_CSprite_RenderOneXLUSprite 0x70D000
5151

52+
#define FUNC_CRadar_DrawMap 0x586B00
53+
#define FUNC_CRadar_DrawBlips 0x588050
54+
5255
#define CODE_ShowMoney 0x58F47D
56+
#define CODE_ShowRadarAltimeter 0x58A5A6
5357

5458
#define VAR_CTheScripts_bDrawCrossHair 0xA44490
5559
#define VAR_RSGlobal 0xC17040

Client/game_sa/CPoolsSA.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
#include "CWorldSA.h"
2727

2828
#include "enums/VehicleClass.h"
29+
#include <new>
2930

3031
extern CGameSA* pGame;
3132

@@ -242,7 +243,7 @@ CObject* CPoolsSA::AddObject(CClientObject* pClientObject, DWORD dwModelID, bool
242243

243244
if (m_objectPool.ulCount < MAX_OBJECTS)
244245
{
245-
pObject = new CObjectSA(dwModelID, bBreakingDisabled);
246+
pObject = new (std::nothrow) CObjectSA(dwModelID, bBreakingDisabled);
246247

247248
if (pObject && AddObjectToPool(pClientObject, pObject))
248249
{

0 commit comments

Comments
 (0)