Skip to content

Commit 4a9445e

Browse files
authored
Merge branch 'master' into restream
2 parents 600fcff + 4b2fcf4 commit 4a9445e

File tree

716 files changed

+27809
-22428
lines changed

Some content is hidden

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

716 files changed

+27809
-22428
lines changed

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/mods/deathmatch/logic/CClientEntity.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -791,7 +791,8 @@ void CClientEntity::CallEventNoParent(const char* szName, const CLuaArguments& A
791791
// Call it on all our children
792792
if (!m_Children.empty())
793793
{
794-
for (CClientEntity* pEntity : *GetChildrenListSnapshot())
794+
CElementListSnapshotRef pChildrenSnapshot = GetChildrenListSnapshot();
795+
for (CClientEntity* pEntity : *pChildrenSnapshot)
795796
{
796797
if (!pEntity->IsBeingDeleted())
797798
{

Client/mods/deathmatch/logic/CClientPed.cpp

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4673,12 +4673,20 @@ float CClientPed::GetDistanceFromGround()
46734673
return (vecPosition.fZ - fGroundLevel);
46744674
}
46754675

4676-
bool CClientPed::IsOnGround()
4676+
bool CClientPed::IsOnGround(bool checkVehicles)
46774677
{
46784678
CVector vecPosition;
46794679
GetPosition(vecPosition);
46804680
float fGroundLevel = static_cast<float>(g_pGame->GetWorld()->FindGroundZFor3DPosition(&vecPosition));
4681-
return (vecPosition.fZ > fGroundLevel && (vecPosition.fZ - fGroundLevel) <= 1.0f);
4681+
4682+
if (DefinitelyLessThan(vecPosition.fZ, fGroundLevel))
4683+
return false;
4684+
4685+
bool isOnGround = DefinitelyLessThan((vecPosition.fZ - fGroundLevel), 1.0f) || EssentiallyEqual((vecPosition.fZ - fGroundLevel), 1.0f);
4686+
if (!isOnGround && checkVehicles && m_pPlayerPed)
4687+
return m_pPlayerPed->IsStandingOnEntity();
4688+
4689+
return isOnGround;
46824690
}
46834691

46844692
bool CClientPed::IsClimbing()

Client/mods/deathmatch/logic/CClientPed.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,7 @@ class CClientPed : public CClientStreamElement, public CAntiCheatModule
380380

381381
void SetInWater(bool bIsInWater) { m_bIsInWater = bIsInWater; };
382382
bool IsInWater();
383-
bool IsOnGround();
383+
bool IsOnGround(bool checkVehicles = false);
384384

385385
bool IsClimbing();
386386
bool IsRadioOn() const noexcept { return m_bRadioOn; };

Client/mods/deathmatch/logic/luadefs/CLuaPedDefs.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -914,13 +914,15 @@ int CLuaPedDefs::IsPedOnGround(lua_State* luaVM)
914914
{
915915
// Verify the argument
916916
CClientPed* pPed = NULL;
917+
bool checkVehicles = false;
917918
CScriptArgReader argStream(luaVM);
918919
argStream.ReadUserData(pPed);
920+
argStream.ReadBool(checkVehicles, false);
919921

920922
if (!argStream.HasErrors())
921923
{
922924
// Find out whether he's on the ground or not and return it
923-
bool bOnGround = pPed->IsOnGround();
925+
bool bOnGround = pPed->IsOnGround(checkVehicles);
924926
lua_pushboolean(luaVM, bOnGround);
925927
return 1;
926928
}

Server/mods/deathmatch/logic/CElement.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1019,7 +1019,8 @@ void CElement::CallEventNoParent(const char* szName, const CLuaArguments& Argume
10191019
}
10201020

10211021
// Call it on all our children
1022-
for (CElement* pElement : *GetChildrenListSnapshot())
1022+
CElementListSnapshotRef childrenList = GetChildrenListSnapshot();
1023+
for (CElement* pElement : *childrenList)
10231024
{
10241025
if (!pElement->IsBeingDeleted())
10251026
{

Server/mods/deathmatch/logic/CResource.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1276,8 +1276,8 @@ void CResource::DisplayInfo() // duplicated for HTML
12761276
{
12771277
if (pIncludedResources->IsBadVersion())
12781278
{
1279-
CLogger::LogPrintf(" %s .. BAD VERSION (not between %d and %d)\n", pIncludedResources->GetMinimumVersion(),
1280-
pIncludedResources->GetMaximumVersion());
1279+
CLogger::LogPrintf(" %s .. BAD VERSION (not between %d and %d)\n", pIncludedResources->GetName().c_str(),
1280+
pIncludedResources->GetMinimumVersion(), pIncludedResources->GetMaximumVersion());
12811281
}
12821282
else
12831283
{

Shared/data/MTA San Andreas/MTA/locale/en_US/client.pot

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ msgid ""
88
msgstr ""
99
"Project-Id-Version: MTA San Andreas 1.x\n"
1010
"Report-Msgid-Bugs-To: \n"
11-
"POT-Creation-Date: 2025-08-11 18:27+0000\n"
11+
"POT-Creation-Date: 2025-08-12 20:34+0000\n"
1212
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
1313
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
1414
"Language-Team: LANGUAGE <[email protected]>\n"
@@ -26,7 +26,7 @@ msgstr ""
2626
#: Client/core/CVersionUpdater.cpp:1938 Client/core/CVersionUpdater.cpp:1956
2727
#: Client/core/CVersionUpdater.cpp:1968 Client/core/CVersionUpdater.cpp:2120
2828
#: Client/core/CVersionUpdater.cpp:2129 Client/core/CVersionUpdater.cpp:2138
29-
#: Client/core/CVersionUpdater.cpp:2152 Client/core/CMainMenu.cpp:1222
29+
#: Client/core/CVersionUpdater.cpp:2152 Client/core/CMainMenu.cpp:1226
3030
#: Client/loader/Dialogs.cpp:37
3131
msgid "OK"
3232
msgstr ""
@@ -52,7 +52,7 @@ msgstr ""
5252
#: Client/core/CSettings.cpp:4777 Client/core/CSettings.cpp:4830
5353
#: Client/core/CVersionUpdater.cpp:1572 Client/core/CVersionUpdater.cpp:1590
5454
#: Client/core/CVersionUpdater.cpp:1859 Client/core/CVersionUpdater.cpp:1878
55-
#: Client/core/CQuestionBox.cpp:195 Client/core/CMainMenu.cpp:1202
55+
#: Client/core/CQuestionBox.cpp:195 Client/core/CMainMenu.cpp:1206
5656
#: Client/core/ServerBrowser/CServerInfo.cpp:481 Client/loader/Dialogs.cpp:35
5757
msgid "Yes"
5858
msgstr ""
@@ -1422,7 +1422,7 @@ msgstr ""
14221422
#: Client/core/CSettings.cpp:4829 Client/core/CVersionUpdater.cpp:1571
14231423
#: Client/core/CVersionUpdater.cpp:1589 Client/core/CVersionUpdater.cpp:1858
14241424
#: Client/core/CVersionUpdater.cpp:1877 Client/core/CQuestionBox.cpp:194
1425-
#: Client/core/CMainMenu.cpp:1201 Client/core/ServerBrowser/CServerInfo.cpp:481
1425+
#: Client/core/CMainMenu.cpp:1205 Client/core/ServerBrowser/CServerInfo.cpp:481
14261426
#: Client/loader/Dialogs.cpp:36
14271427
msgid "No"
14281428
msgstr ""
@@ -2066,26 +2066,26 @@ msgstr ""
20662066
msgid "reconnect: Bad port number"
20672067
msgstr ""
20682068

2069-
#: Client/core/CCommandFuncs.cpp:321
2069+
#: Client/core/CCommandFuncs.cpp:325
20702070
#, c-format
20712071
msgid "reconnect: Reconnecting to %s:%u..."
20722072
msgstr ""
20732073

2074-
#: Client/core/CCommandFuncs.cpp:325
2074+
#: Client/core/CCommandFuncs.cpp:329
20752075
#, c-format
20762076
msgid "reconnect: could not connect to %s:%u!"
20772077
msgstr ""
20782078

2079-
#: Client/core/CCommandFuncs.cpp:359
2079+
#: Client/core/CCommandFuncs.cpp:363
20802080
msgid "Bound all controls from GTA"
20812081
msgstr ""
20822082

2083-
#: Client/core/CCommandFuncs.cpp:373
2083+
#: Client/core/CCommandFuncs.cpp:377
20842084
msgid "Saved configuration file"
20852085
msgstr ""
20862086

20872087
#. Print it
2088-
#: Client/core/CCommandFuncs.cpp:452
2088+
#: Client/core/CCommandFuncs.cpp:456
20892089
#, c-format
20902090
msgid "* Your serial is: %s"
20912091
msgstr ""
@@ -2117,18 +2117,18 @@ msgid ""
21172117
"Upgrade Windows to play on the latest servers."
21182118
msgstr ""
21192119

2120-
#: Client/core/CMainMenu.cpp:1195
2120+
#: Client/core/CMainMenu.cpp:1199
21212121
msgid ""
21222122
"This will disconnect you from the current server.\n"
21232123
"\n"
21242124
"Are you sure you want to disconnect?"
21252125
msgstr ""
21262126

2127-
#: Client/core/CMainMenu.cpp:1199
2127+
#: Client/core/CMainMenu.cpp:1203
21282128
msgid "DISCONNECT WARNING"
21292129
msgstr ""
21302130

2131-
#: Client/core/CMainMenu.cpp:1220
2131+
#: Client/core/CMainMenu.cpp:1224
21322132
msgid "INFORMATION"
21332133
msgstr ""
21342134

Shared/sdk/SharedUtil.Math.h

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,4 +118,25 @@ namespace SharedUtil
118118
{
119119
return std::fabs(a - b) <= epsilon;
120120
}
121+
122+
inline bool ApproximatelyEqual(float a, float b, float epsilon = std::numeric_limits<float>().epsilon()) noexcept
123+
{
124+
return std::fabs(a - b) <= std::max(std::fabs(a), std::fabs(b)) * epsilon;
125+
}
126+
127+
inline bool EssentiallyEqual(float a, float b, float epsilon = std::numeric_limits<float>().epsilon()) noexcept
128+
{
129+
return std::fabs(a - b) <= std::min(std::fabs(a), std::fabs(b)) * epsilon;
130+
}
131+
132+
inline bool DefinitelyGreaterThan(float a, float b, float epsilon = std::numeric_limits<float>().epsilon()) noexcept
133+
{
134+
return (a - b) > std::max(std::fabs(a), std::fabs(b)) * epsilon;
135+
}
136+
137+
inline bool DefinitelyLessThan(float a, float b, float epsilon = std::numeric_limits<float>().epsilon()) noexcept
138+
{
139+
return (b - a) > std::max(std::fabs(a), std::fabs(b)) * epsilon;
140+
}
141+
121142
} // namespace SharedUtil

vendor/cegui-0.4.0-custom/src/CEGUIString.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ String::~String(void)
4949
if (d_encodedbufflen > 0)
5050
{
5151
delete[] d_encodedbuff;
52+
d_encodedbuff = nullptr;
5253
}
5354
}
5455

@@ -123,6 +124,7 @@ utf8* String::build_utf8_buff(void) const
123124
if (d_encodedbufflen > 0)
124125
{
125126
delete[] d_encodedbuff;
127+
d_encodedbuff = nullptr;
126128
}
127129

128130
d_encodedbuff = new utf8[buffsize];

0 commit comments

Comments
 (0)