Skip to content

Commit e2f3df2

Browse files
committed
Merge branch 'master' into feature/setPedJetpack
2 parents 961ae36 + c2d1a08 commit e2f3df2

Some content is hidden

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

82 files changed

+57627
-40538
lines changed

.github/ISSUE_TEMPLATE/security-report.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ about: Submit cheat or security vulnerability
44

55
---
66

7+
STOP RIGHT THERE!
8+
79
Please submit your cheats or security vulnerabilities to @ccw on forum.mtasa.com. Please do not submit them here.
810

911
@ccw can be found here: https://forum.mtasa.com/profile/7264-ccw/

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -410,9 +410,9 @@ __pycache__/
410410
Bin/
411411
Build/
412412
InstallFiles/
413-
utils/vswhere.exe
414413
utils/DXFiles.zip
415414
utils/DXFiles/
416415
!*.so
417416
!*.dll
418417
!*.exe
418+
utils/vswhere.exe

.travis.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ language: cpp
22
sudo: false
33
dist: trusty
44

5+
git:
6+
depth: 1
7+
58
matrix:
69
include:
710
- compiler: gcc

Client/cefweb/CWebView.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -752,7 +752,7 @@ void CWebView::OnLoadError(CefRefPtr<CefBrowser> browser, CefRefPtr<CefFrame> fr
752752
// //
753753
// //
754754
////////////////////////////////////////////////////////////////////
755-
bool CWebView::OnBeforeBrowse(CefRefPtr<CefBrowser> browser, CefRefPtr<CefFrame> frame, CefRefPtr<CefRequest> request, bool isRedirect)
755+
bool CWebView::OnBeforeBrowse(CefRefPtr<CefBrowser> browser, CefRefPtr<CefFrame> frame, CefRefPtr<CefRequest> request, bool userGesture, bool isRedirect)
756756
{
757757
/*
758758
From documentation:

Client/cefweb/CWebView.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ class CWebView : public CWebViewInterface,
129129
const CefString& failedURL) override;
130130

131131
// CefRequestHandler methods
132-
virtual bool OnBeforeBrowse(CefRefPtr<CefBrowser> browser, CefRefPtr<CefFrame> frame, CefRefPtr<CefRequest> request, bool isRedirect) override;
132+
virtual bool OnBeforeBrowse(CefRefPtr<CefBrowser> browser, CefRefPtr<CefFrame> frame, CefRefPtr<CefRequest> request, bool userGesture, bool isRedirect) override;
133133
virtual CefRequestHandler::ReturnValue OnBeforeResourceLoad(CefRefPtr<CefBrowser> browser, CefRefPtr<CefFrame> frame, CefRefPtr<CefRequest> request,
134134
CefRefPtr<CefRequestCallback> callback) override;
135135

Client/core/CCommandFuncs.cpp

Lines changed: 45 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -234,62 +234,63 @@ void CCommandFuncs::Unload(const char* szParameters)
234234

235235
void CCommandFuncs::Connect(const char* szParameters)
236236
{
237-
CModManager::GetSingleton().Unload();
237+
// Parse the arguments (host port nick pass)
238+
char szBuffer[256] = "";
239+
if (szParameters)
240+
STRNCPY(szBuffer, szParameters, NUMELMS(szBuffer));
238241

239-
// Any mod loaded?
240-
if (!CModManager::GetSingleton().GetCurrentMod())
242+
if (!strncmp(szBuffer, "mtasa://", 8))
241243
{
242-
// Parse the arguments (host port nick pass)
243-
char szBuffer[256] = "";
244-
if (szParameters)
245-
STRNCPY(szBuffer, szParameters, NUMELMS(szBuffer));
244+
// Using a mtasa:// URI to connect
245+
SString strArguments = g_pCore->GetConnectCommandFromURI(szBuffer);
246246

247-
if (!strncmp(szBuffer, "mtasa://", 8))
247+
if (strArguments.length() > 0 && g_pCore->GetCommands()->Execute(strArguments))
248248
{
249-
// Using a mtasa:// URI to connect
250-
SString strArguments = g_pCore->GetConnectCommandFromURI(szBuffer);
251-
252-
if (strArguments.length() > 0 && g_pCore->GetCommands()->Execute(strArguments))
253-
{
254-
return;
255-
}
249+
return;
256250
}
251+
}
257252

258-
char* szHost = strtok(szBuffer, " ");
259-
char* szPort = strtok(NULL, " ");
260-
char* szNick = strtok(NULL, " ");
261-
char* szPass = strtok(NULL, " ");
253+
char* szHost = strtok(szBuffer, " ");
254+
char* szPort = strtok(NULL, " ");
255+
char* szNick = strtok(NULL, " ");
256+
char* szPass = strtok(NULL, " ");
262257

263-
std::string strNick;
264-
if (!szNick)
265-
CVARS_GET("nick", strNick);
266-
else
267-
strNick = szNick;
258+
std::string strNick;
259+
if (!szNick)
260+
CVARS_GET("nick", strNick);
261+
else
262+
strNick = szNick;
268263

269-
// Got all required arguments?
270-
if (!szHost || !szPort || strNick.empty())
271-
{
272-
CCore::GetSingleton().GetConsole()->Print(_("connect: Syntax is 'connect <host> <port> [<nick> <pass>]'"));
273-
return;
274-
}
264+
// Got all required arguments?
265+
if (!szHost || strNick.empty())
266+
{
267+
CCore::GetSingleton().GetConsole()->Print(_("connect: Syntax is 'connect <host> [<port> <nick> <pass>]'"));
268+
return;
269+
}
275270

276-
// Verify and convert the port number
277-
int iPort = atoi(szPort);
278-
if (iPort <= 0 || iPort > 0xFFFF)
279-
{
280-
CCore::GetSingleton().GetConsole()->Print(_("connect: Bad port number"));
281-
return;
282-
}
271+
// Verify and convert the port number
272+
int iPort = szPort ? atoi(szPort) : 22003;
273+
if (iPort <= 0 || iPort > 0xFFFF)
274+
{
275+
CCore::GetSingleton().GetConsole()->Print(_("connect: Bad port number"));
276+
return;
277+
}
283278

284-
unsigned short usPort = static_cast<unsigned short>(iPort);
279+
unsigned short usPort = static_cast<unsigned short>(iPort);
285280

286-
// Got a password?
287-
char emptyPass = 0;
288-
if (!szPass)
289-
{
290-
szPass = &emptyPass;
291-
}
281+
// Got a password?
282+
char emptyPass = 0;
283+
if (!szPass)
284+
{
285+
szPass = &emptyPass;
286+
}
292287

288+
// Unload any mod before connecting to a server
289+
CModManager::GetSingleton().Unload();
290+
291+
// Only connect if there is no mod loaded
292+
if (!CModManager::GetSingleton().GetCurrentMod())
293+
{
293294
// Start the connect
294295
if (CCore::GetSingleton().GetConnectManager()->Connect(szHost, usPort, strNick.c_str(), szPass))
295296
{

Client/core/CCredits.cpp

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,14 +45,14 @@ CCredits::CCredits(void)
4545
L"Raphael \"Mr.Hankey\" Leiteritz\n"
4646
L"Ed \"eAi\" Lyons\n"
4747
L"Christian \"ChrML\" Myhre Lundheim\n"
48+
L"Qais \"qaisjp\" Patankar\n"
4849
L"Arushan \"aru\" Raj\n"
4950
L"Frank \"Aim\" Spijkerman\n"
5051
L"Pascal \"sbx320\" Stücker\n"
5152
L"Kevin \"Kevuwk\" Whiteside\n"
5253
L"Richard \"Cazomino05\" Whitlock\n"
5354
L"Gamesnert\n"
5455
L"Jusonex\n"
55-
L"Qais \"qaisjp\" Patankar\n"
5656
L"\n"
5757
L"\n");
5858

@@ -61,14 +61,15 @@ CCredits::CCredits(void)
6161
"\n\n"
6262

6363
"Arran\n"
64-
"Remp\n"
65-
"MX_Master\n"
64+
"Dutchman101\n"
6665
"Iztas\n"
6766
"impulze\n"
6867
"JoeBullet\n"
6968
"lopezloo\n"
69+
"MX_Master\n"
7070
"Marek \"Necktrox\" Kulik\n"
71-
"Dutchman101\n"
71+
"Remp\n"
72+
"Danish \"Saml1er\" Khan\n"
7273
"\n";
7374

7475
m_strCredits += _("Game Design / Scripting");
@@ -142,6 +143,10 @@ CCredits::CCredits(void)
142143
"JR10\n"
143144
"PhrozenByte\n"
144145
"AboShanab\n"
146+
"GTX / Timic3\n"
147+
"Patrik \"myonlake\" Juvonen\n"
148+
"FileEX\n"
149+
"Pirulax\n"
145150
"\n";
146151
"\n";
147152

Client/core/CGUI.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
#include "StdInc.h"
1313
#include <game/CGame.h>
14+
#include <windowsx.h>
1415

1516
using std::string;
1617

@@ -541,7 +542,7 @@ bool CLocalGUI::ProcessMessage(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPara
541542
return true;
542543

543544
case WM_MOUSEMOVE:
544-
pGUI->ProcessMouseInput(CGUI_MI_MOUSEPOS, LOWORD(lParam), HIWORD(lParam));
545+
pGUI->ProcessMouseInput(CGUI_MI_MOUSEPOS, GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam));
545546
return true;
546547

547548
case WM_LBUTTONDOWN:

Client/core/CMouseControl.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
#include "StdInc.h"
1313
#include "CMouseControl.h"
14+
#include <windowsx.h>
1415
#include <game/CGame.h>
1516

1617
#define MOUSE_CONTROL_MULTIPLIER 35
@@ -78,7 +79,7 @@ bool CMouseControl::ProcessMouseMove(UINT uMsg, WPARAM wParam, LPARAM lParam)
7879

7980
// Let's calculate our mouse movement directions
8081
CVector2D resolution = g_pCore->GetGUI()->GetResolution();
81-
int iX = LOWORD(lParam), iY = HIWORD(lParam);
82+
int iX = GET_X_LPARAM(lParam), iY = GET_Y_LPARAM(lParam);
8283
float fX = (iX - resolution.fX * 0.5f) / resolution.fX;
8384

8485
fX *= MOUSE_CONTROL_MULTIPLIER;
@@ -137,4 +138,4 @@ void CMouseControl::ApplyAxes(CControllerState& cs)
137138

138139
cs.LeftStickX = m_usLeftStickX;
139140
cs.LeftStickY = m_usLeftStickY;
140-
}
141+
}

Client/game_sa/CSettingsSA.cpp

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ void HOOK_GetFxQuality();
3535
DWORD RETURN_StoreShadowForVehicle = 0x70BDA9;
3636
void HOOK_StoreShadowForVehicle();
3737

38-
float ms_fVehicleLODDistance, ms_fTrainPlaneLODDistance;
38+
float ms_fVehicleLODDistance, ms_fTrainPlaneLODDistance, ms_fPedsLODDistance;
3939

4040
CSettingsSA::CSettingsSA(void)
4141
{
@@ -52,6 +52,7 @@ CSettingsSA::CSettingsSA(void)
5252

5353
MemPut(0x732926, &ms_fVehicleLODDistance);
5454
MemPut(0x732940, &ms_fTrainPlaneLODDistance);
55+
MemPut(0x73295E, &ms_fPedsLODDistance);
5556

5657
// Set "radar map and radar" as default radar mode
5758
SetRadarMode(RADAR_MODE_ALL);
@@ -590,6 +591,36 @@ void CSettingsSA::GetVehiclesLODDistance(float& fVehiclesLODDistance, float& fTr
590591
fTrainsPlanesLODDistance = ms_fTrainPlaneLODDistance;
591592
}
592593

594+
////////////////////////////////////////////////
595+
//
596+
// Peds LOD draw distance
597+
//
598+
////////////////////////////////////////////////
599+
600+
void CSettingsSA::SetPedsLODDistance(float fPedsLODDistance)
601+
{
602+
ms_fPedsLODDistance = fPedsLODDistance;
603+
}
604+
605+
float CSettingsSA::GetPedsLODDistance()
606+
{
607+
return ms_fPedsLODDistance;
608+
}
609+
610+
void CSettingsSA::ResetPedsLODDistance()
611+
{
612+
bool bHighDetailPeds;
613+
g_pCore->GetCVars()->Get("high_detail_peds", bHighDetailPeds);
614+
if (bHighDetailPeds)
615+
{
616+
ms_fPedsLODDistance = MAX_PEDS_LOD_DISTANCE;
617+
}
618+
else
619+
{
620+
ms_fPedsLODDistance = DEFAULT_PEDS_LOD_DISTANCE;
621+
}
622+
}
623+
593624
////////////////////////////////////////////////
594625
//
595626
// CSettingsSA::HasUnsafeResolutions

0 commit comments

Comments
 (0)