Skip to content

Commit 9d0e006

Browse files
authored
Merge branch 'master' into shapedefs
2 parents 6a37500 + 1e24eac commit 9d0e006

File tree

94 files changed

+1355
-2525
lines changed

Some content is hidden

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

94 files changed

+1355
-2525
lines changed

Client/core/CGUI.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ void CLocalGUI::CreateWindows(bool bGameIsAlreadyLoaded)
158158
m_pLabelVersionTag->SetTextColor(255, 255, 255);
159159
m_pLabelVersionTag->SetZOrderingEnabled(false);
160160
m_pLabelVersionTag->MoveToBack();
161-
if (MTASA_VERSION_TYPE < VERSION_TYPE_RELEASE)
161+
if (MTASA_VERSION_TYPE < VERSION_TYPE_UNTESTED)
162162
m_pLabelVersionTag->SetAlwaysOnTop(true);
163163

164164
// Create mainmenu

Client/launch/Multi Theft Auto.manifest

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
22
<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1" xmlns:v3="urn:schemas-microsoft-com:asm.v3">
3-
<assemblyIdentity type="win32" version="1.6.0.0" processorArchitecture="*" name="Multi Theft Auto" />
3+
<assemblyIdentity type="win32" version="1.7.0.0" processorArchitecture="*" name="Multi Theft Auto" />
44

55
<v3:application>
66
<windowsSettings>

Client/launch/NEU/.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
*.xml diff working-tree-encoding=UTF-16 eol=crlf
-3.83 KB
Binary file not shown.

Client/launch/launch.rc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,8 @@ IDI_ICON1 ICON "resource\\mtaicon.ico"
7171
//
7272

7373
VS_VERSION_INFO VERSIONINFO
74-
FILEVERSION 1,6,0,0
75-
PRODUCTVERSION 1,6,0,0
74+
FILEVERSION 1,7,0,0
75+
PRODUCTVERSION 1,7,0,0
7676
FILEFLAGSMASK 0x17L
7777
#ifdef _DEBUG
7878
FILEFLAGS 0x1L
@@ -89,10 +89,10 @@ BEGIN
8989
BEGIN
9090
VALUE "CompanyName", "Multi Theft Auto"
9191
VALUE "FileDescription", "Multi Theft Auto Launcher"
92-
VALUE "FileVersion", "1.6.0.0"
93-
VALUE "LegalCopyright", "(C) 2003 - 2023 Multi Theft Auto"
92+
VALUE "FileVersion", "1.7.0.0"
93+
VALUE "LegalCopyright", "(C) 2003 - 2025 Multi Theft Auto"
9494
VALUE "ProductName", "MTA San Andreas"
95-
VALUE "ProductVersion", "1.6.0.0"
95+
VALUE "ProductVersion", "1.7.0.0"
9696
END
9797
END
9898
BLOCK "VarFileInfo"

Client/loader/CInstallManager.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -432,10 +432,10 @@ SString CInstallManager::_ShowCrashFailDialog()
432432
strMessage += strReason;
433433
}
434434

435-
const SString moduleName = GetApplicationSetting("diagnostics", "last-crash-module");
436-
const int exceptionCode = GetApplicationSettingInt("diagnostics", "last-crash-code");
435+
// const SString moduleName = GetApplicationSetting("diagnostics", "last-crash-module");
436+
const int exceptionCode = GetApplicationSettingInt("diagnostics", "last-crash-code");
437437

438-
if (exceptionCode == CUSTOM_EXCEPTION_CODE_OOM && moduleName.EndsWithI("\\kernelbase.dll"))
438+
if (exceptionCode == CUSTOM_EXCEPTION_CODE_OOM)
439439
{
440440
strMessage += '\n';
441441
strMessage += _("** Out of memory - this crash was caused by insufficient free or fragmented memory. **");

Client/loader/MainFunctions.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -977,7 +977,7 @@ void CheckDataFiles()
977977
//////////////////////////////////////////////////////////
978978
void CheckLibVersions()
979979
{
980-
#if MTASA_VERSION_TYPE == VERSION_TYPE_RELEASE
980+
#if MTASA_VERSION_TYPE < VERSION_TYPE_UNTESTED
981981

982982
const char* moduleList[] = {"MTA\\loader.dll",
983983
"MTA\\cgui.dll",

Client/mods/deathmatch/CClient.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ int CClient::ClientInitialize(const char* szArguments, CCoreInterface* pCore)
3333
// Make public client test builds expire
3434
if (GetDaysUntilExpire() < -1)
3535
{
36-
MessageBox(NULL, _("This version has expired."), "MTA: San Andreas " MTA_DM_BUILDTAG_LONG + _E("CD64"), MB_OK | MB_ICONEXCLAMATION | MB_TOPMOST);
36+
MessageBoxA(NULL, _("This version has expired."), SStringX("MTA: San Andreas " MTA_DM_BUILDTAG_LONG) + _E("CD64"),
37+
MB_OK | MB_ICONEXCLAMATION | MB_TOPMOST);
3738
TerminateProcess(GetCurrentProcess(), 1);
3839
}
3940
#endif

Client/mods/deathmatch/logic/CClientColTube.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class CClientColTube final : public CClientColShape
2626
float GetRadius() { return m_fRadius; };
2727
void SetRadius(float fRadius)
2828
{
29-
m_fRadius = fRadius;
29+
m_fRadius = (fRadius / 2.0f) + 0.15f;
3030
SizeChanged();
3131
};
3232
float GetHeight() { return m_fHeight; };

Client/mods/deathmatch/logic/CClientGame.cpp

Lines changed: 41 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -703,16 +703,10 @@ bool CClientGame::StartGame(const char* szNick, const char* szPassword, eServerT
703703
pBitStream->Write(strTemp.c_str(), MAX_PLAYER_NICK_LENGTH);
704704
pBitStream->Write(reinterpret_cast<const char*>(Password.data), sizeof(MD5));
705705

706-
// Append community information (Removed)
706+
// Append community information (removed, but we keep this to retain protocol compat)
707707
std::string strUser;
708708
pBitStream->Write(strUser.c_str(), MAX_SERIAL_LENGTH);
709709

710-
// Send an empty string if server still has old Discord implementation (#2499)
711-
if (g_pNet->CanServerBitStream(eBitStreamVersion::Discord_InitialImplementation) && !g_pNet->CanServerBitStream(eBitStreamVersion::Discord_Cleanup))
712-
{
713-
pBitStream->WriteString<uchar>("");
714-
}
715-
716710
// Send the packet as joindata
717711
g_pNet->SendPacket(PACKET_ID_PLAYER_JOINDATA, pBitStream, PACKET_PRIORITY_HIGH, PACKET_RELIABILITY_RELIABLE_ORDERED);
718712
g_pNet->DeallocateNetBitStream(pBitStream);
@@ -1829,12 +1823,10 @@ void CClientGame::UpdatePlayerWeapons()
18291823
SWeaponSlotSync slot;
18301824

18311825
// Always send bit in case server is not in sync
1832-
if ((BitStream.Version() >= 0x44 && m_lastWeaponSlot == WEAPONSLOT_TYPE_THROWN) || BitStream.Version() >= 0x4D)
18331826
{
18341827
CWeapon* pLastWeapon = m_pLocalPlayer->GetWeapon(m_lastWeaponSlot);
18351828
if (pLastWeapon && pLastWeapon->GetAmmoTotal() == 0 &&
1836-
(m_lastWeaponSlot == WEAPONSLOT_TYPE_THROWN ||
1837-
(BitStream.Version() >= 0x5A && (m_lastWeaponSlot == WEAPONSLOT_TYPE_HEAVY || m_lastWeaponSlot == WEAPONSLOT_TYPE_SPECIAL))))
1829+
(m_lastWeaponSlot == WEAPONSLOT_TYPE_THROWN || m_lastWeaponSlot == WEAPONSLOT_TYPE_HEAVY || m_lastWeaponSlot == WEAPONSLOT_TYPE_SPECIAL))
18381830
BitStream.WriteBit(true);
18391831
else
18401832
BitStream.WriteBit(false);
@@ -2638,6 +2630,8 @@ void CClientGame::AddBuiltInEvents()
26382630
m_Events.AddEvent("onClientElementModelChange", "oldModel, newModel", nullptr, false);
26392631
m_Events.AddEvent("onClientElementDimensionChange", "oldDimension, newDimension", nullptr, false);
26402632
m_Events.AddEvent("onClientElementInteriorChange", "oldInterior, newInterior", nullptr, false);
2633+
m_Events.AddEvent("onClientElementAttach", "attachSource, attachOffsetX, attachOffsetY, attachOffsetZ, attachOffsetRX, attachOffsetRY, attachOffsetRZ", nullptr, false);
2634+
m_Events.AddEvent("onClientElementDetach", "detachSource, detachWorldX, detachWorldY, detachWorldZ, detachWorldRX, detachWorldRY, detachWorldRZ", nullptr, false);
26412635

26422636
// Player events
26432637
m_Events.AddEvent("onClientPlayerJoin", "", NULL, false);
@@ -2743,10 +2737,13 @@ void CClientGame::AddBuiltInEvents()
27432737
m_Events.AddEvent("onClientCursorMove", "relativeX, relativeX, absoluteX, absoluteY, worldX, worldY, worldZ", NULL, false);
27442738

27452739
// Marker events
2746-
m_Events.AddEvent("onClientMarkerHit", "entity, matchingDimension", NULL, false);
2747-
m_Events.AddEvent("onClientMarkerLeave", "entity, matchingDimension", NULL, false);
2740+
m_Events.AddEvent("onClientMarkerHit", "entity, matchingDimension", nullptr, false);
2741+
m_Events.AddEvent("onClientMarkerLeave", "entity, matchingDimension", nullptr, false);
27482742

2749-
// Marker events
2743+
m_Events.AddEvent("onClientPlayerMarkerHit", "marker, matchingDimension", nullptr, false);
2744+
m_Events.AddEvent("onClientPlayerMarkerLeave", "marker, matchingDimension", nullptr, false);
2745+
2746+
// Pickup events
27502747
m_Events.AddEvent("onClientPickupHit", "entity, matchingDimension", NULL, false);
27512748
m_Events.AddEvent("onClientPickupLeave", "entity, matchingDimension", NULL, false);
27522749

@@ -4625,34 +4622,32 @@ bool CClientGame::VehicleCollisionHandler(CVehicleSAInterface*& pCollidingVehicl
46254622
// Make sure it created
46264623
if (pBitStream)
46274624
{
4628-
if (pBitStream->Version() >= 0x028)
4625+
// Sync Stuff
4626+
// if it's not a local vehicle + it collided with the local player
4627+
if (pVehicleClientEntity->IsLocalEntity() == false && pCollidedWithClientEntity == g_pClientGame->GetLocalPlayer())
46294628
{
4630-
// Sync Stuff
4631-
// if it's not a local vehicle + it collided with the local player
4632-
if (pVehicleClientEntity->IsLocalEntity() == false && pCollidedWithClientEntity == g_pClientGame->GetLocalPlayer())
4629+
// is it below the anti spam threshold?
4630+
if (pClientVehicle->GetTimeSinceLastPush() >= MIN_PUSH_ANTISPAM_RATE)
46334631
{
4634-
// is it below the anti spam threshold?
4635-
if (pClientVehicle->GetTimeSinceLastPush() >= MIN_PUSH_ANTISPAM_RATE)
4632+
// if there is no controlling player
4633+
if (!pClientVehicle->GetControllingPlayer())
46364634
{
4637-
// if there is no controlling player
4638-
if (!pClientVehicle->GetControllingPlayer())
4635+
CDeathmatchVehicle* Vehicle = static_cast<CDeathmatchVehicle*>(pVehicleClientEntity);
4636+
// if We aren't already syncing the vehicle
4637+
if (GetUnoccupiedVehicleSync()->Exists(Vehicle) == false)
46394638
{
4640-
CDeathmatchVehicle* Vehicle = static_cast<CDeathmatchVehicle*>(pVehicleClientEntity);
4641-
// if We aren't already syncing the vehicle
4642-
if (GetUnoccupiedVehicleSync()->Exists(Vehicle) == false)
4643-
{
4644-
// Write the vehicle ID
4645-
pBitStream->Write(pVehicleClientEntity->GetID());
4646-
// Send!
4647-
g_pNet->SendPacket(PACKET_ID_VEHICLE_PUSH_SYNC, pBitStream, PACKET_PRIORITY_MEDIUM,
4648-
PACKET_RELIABILITY_UNRELIABLE_SEQUENCED);
4649-
// Reset our push time
4650-
pClientVehicle->ResetLastPushTime();
4651-
}
4639+
// Write the vehicle ID
4640+
pBitStream->Write(pVehicleClientEntity->GetID());
4641+
// Send!
4642+
g_pNet->SendPacket(PACKET_ID_VEHICLE_PUSH_SYNC, pBitStream, PACKET_PRIORITY_MEDIUM,
4643+
PACKET_RELIABILITY_UNRELIABLE_SEQUENCED);
4644+
// Reset our push time
4645+
pClientVehicle->ResetLastPushTime();
46524646
}
46534647
}
46544648
}
46554649
}
4650+
46564651
g_pNet->DeallocateNetBitStream(pBitStream);
46574652
}
46584653
return true;
@@ -5281,18 +5276,15 @@ void CClientGame::SendExplosionSync(const CVector& vecPosition, eExplosionType T
52815276

52825277
// Because we use this packet to notify the server of blown vehicles,
52835278
// we include a bit, whether the vehicle was blown without an explosion
5284-
if (pBitStream->Can(eBitStreamVersion::VehicleBlowStateSupport))
5279+
if (pOrigin->GetType() == CCLIENTVEHICLE)
52855280
{
5286-
if (pOrigin->GetType() == CCLIENTVEHICLE)
5287-
{
5288-
auto vehicle = reinterpret_cast<CClientVehicle*>(pOrigin);
5289-
pBitStream->WriteBit(1);
5290-
pBitStream->WriteBit(vehicleBlowState.value_or(vehicle->GetBlowState()) == VehicleBlowState::BLOWN);
5291-
}
5292-
else
5293-
{
5294-
pBitStream->WriteBit(0);
5295-
}
5281+
auto vehicle = reinterpret_cast<CClientVehicle*>(pOrigin);
5282+
pBitStream->WriteBit(1);
5283+
pBitStream->WriteBit(vehicleBlowState.value_or(vehicle->GetBlowState()) == VehicleBlowState::BLOWN);
5284+
}
5285+
else
5286+
{
5287+
pBitStream->WriteBit(0);
52965288
}
52975289

52985290
// Convert position
@@ -5365,9 +5357,7 @@ void CClientGame::SendProjectileSync(CClientProjectile* pProjectile)
53655357
pBitStream->Write(&weaponTypeSync);
53665358

53675359
// Write the projectile's model
5368-
if (pBitStream->Version() >= 0x4F)
5369-
if (pBitStream->Version() >= 0x52 || pOriginSource) // Fix possible error for 0x51 server
5370-
pBitStream->Write(pProjectile->GetModel());
5360+
pBitStream->Write(pProjectile->GetModel());
53715361

53725362
switch (weaponType)
53735363
{
@@ -6257,10 +6247,7 @@ void CClientGame::TakePlayerScreenShot(uint uiSizeX, uint uiSizeY, const SString
62576247
else
62586248
pBitStream->Write((uchar)EPlayerScreenShotResult::MINIMIZED);
62596249
pBitStream->Write(uiServerSentTime);
6260-
if (pBitStream->Version() >= 0x053)
6261-
pBitStream->Write(pResource->GetNetID());
6262-
else
6263-
pBitStream->WriteString(pResource->GetName());
6250+
pBitStream->Write(pResource->GetNetID());
62646251
pBitStream->WriteString(strTag);
62656252
g_pNet->SendPacket(PACKET_ID_PLAYER_SCREENSHOT, pBitStream, PACKET_PRIORITY_LOW, PACKET_RELIABILITY_RELIABLE_ORDERED, PACKET_ORDERING_DATA_TRANSFER);
62666253
g_pNet->DeallocateNetBitStream(pBitStream);
@@ -6325,13 +6312,9 @@ void CClientGame::GottenPlayerScreenShot(const CBuffer* pBuffer, uint uiTimeSpen
63256312
NetBitStreamInterface* pBitStream = g_pNet->AllocateNetBitStream();
63266313
pBitStream->Write((uchar)EPlayerScreenShotResult::ERROR_);
63276314
pBitStream->Write(uiServerGrabTime);
6328-
if (pBitStream->Version() >= 0x053)
6329-
pBitStream->Write(pResource->GetNetID());
6330-
else
6331-
pBitStream->WriteString(pResource->GetName());
6315+
pBitStream->Write(pResource->GetNetID());
63326316
pBitStream->WriteString(strTag);
6333-
if (pBitStream->Version() >= 0x053)
6334-
pBitStream->WriteString(strError);
6317+
pBitStream->WriteString(strError);
63356318
g_pNet->SendPacket(PACKET_ID_PLAYER_SCREENSHOT, pBitStream, PACKET_PRIORITY_LOW, PACKET_RELIABILITY_RELIABLE_ORDERED, PACKET_ORDERING_DATA_TRANSFER);
63366319
g_pNet->DeallocateNetBitStream(pBitStream);
63376320
return;
@@ -6371,10 +6354,7 @@ void CClientGame::GottenPlayerScreenShot(const CBuffer* pBuffer, uint uiTimeSpen
63716354
pBitStream->Write(uiServerGrabTime);
63726355
pBitStream->Write(uiTotalByteSize);
63736356
pBitStream->Write((ushort)uiNumParts);
6374-
if (pBitStream->Version() >= 0x053)
6375-
pBitStream->Write(pResource->GetNetID());
6376-
else
6377-
pBitStream->WriteString(pResource->GetName());
6357+
pBitStream->Write(pResource->GetNetID());
63786358
pBitStream->WriteString(strTag);
63796359
}
63806360

0 commit comments

Comments
 (0)