Skip to content

Commit 3fe05ed

Browse files
authored
Merge branch 'master' into attach
2 parents 9bfd7dc + 820c22e commit 3fe05ed

File tree

82 files changed

+1036
-2403
lines changed

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

+1036
-2403
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/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/CClientGame.cpp

Lines changed: 39 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);
@@ -2745,10 +2737,13 @@ void CClientGame::AddBuiltInEvents()
27452737
m_Events.AddEvent("onClientCursorMove", "relativeX, relativeX, absoluteX, absoluteY, worldX, worldY, worldZ", NULL, false);
27462738

27472739
// Marker events
2748-
m_Events.AddEvent("onClientMarkerHit", "entity, matchingDimension", NULL, false);
2749-
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);
27502742

2751-
// Marker events
2743+
m_Events.AddEvent("onClientPlayerMarkerHit", "marker, matchingDimension", nullptr, false);
2744+
m_Events.AddEvent("onClientPlayerMarkerLeave", "marker, matchingDimension", nullptr, false);
2745+
2746+
// Pickup events
27522747
m_Events.AddEvent("onClientPickupHit", "entity, matchingDimension", NULL, false);
27532748
m_Events.AddEvent("onClientPickupLeave", "entity, matchingDimension", NULL, false);
27542749

@@ -4627,34 +4622,32 @@ bool CClientGame::VehicleCollisionHandler(CVehicleSAInterface*& pCollidingVehicl
46274622
// Make sure it created
46284623
if (pBitStream)
46294624
{
4630-
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())
46314628
{
4632-
// Sync Stuff
4633-
// if it's not a local vehicle + it collided with the local player
4634-
if (pVehicleClientEntity->IsLocalEntity() == false && pCollidedWithClientEntity == g_pClientGame->GetLocalPlayer())
4629+
// is it below the anti spam threshold?
4630+
if (pClientVehicle->GetTimeSinceLastPush() >= MIN_PUSH_ANTISPAM_RATE)
46354631
{
4636-
// is it below the anti spam threshold?
4637-
if (pClientVehicle->GetTimeSinceLastPush() >= MIN_PUSH_ANTISPAM_RATE)
4632+
// if there is no controlling player
4633+
if (!pClientVehicle->GetControllingPlayer())
46384634
{
4639-
// if there is no controlling player
4640-
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)
46414638
{
4642-
CDeathmatchVehicle* Vehicle = static_cast<CDeathmatchVehicle*>(pVehicleClientEntity);
4643-
// if We aren't already syncing the vehicle
4644-
if (GetUnoccupiedVehicleSync()->Exists(Vehicle) == false)
4645-
{
4646-
// Write the vehicle ID
4647-
pBitStream->Write(pVehicleClientEntity->GetID());
4648-
// Send!
4649-
g_pNet->SendPacket(PACKET_ID_VEHICLE_PUSH_SYNC, pBitStream, PACKET_PRIORITY_MEDIUM,
4650-
PACKET_RELIABILITY_UNRELIABLE_SEQUENCED);
4651-
// Reset our push time
4652-
pClientVehicle->ResetLastPushTime();
4653-
}
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();
46544646
}
46554647
}
46564648
}
46574649
}
4650+
46584651
g_pNet->DeallocateNetBitStream(pBitStream);
46594652
}
46604653
return true;
@@ -5283,18 +5276,15 @@ void CClientGame::SendExplosionSync(const CVector& vecPosition, eExplosionType T
52835276

52845277
// Because we use this packet to notify the server of blown vehicles,
52855278
// we include a bit, whether the vehicle was blown without an explosion
5286-
if (pBitStream->Can(eBitStreamVersion::VehicleBlowStateSupport))
5279+
if (pOrigin->GetType() == CCLIENTVEHICLE)
52875280
{
5288-
if (pOrigin->GetType() == CCLIENTVEHICLE)
5289-
{
5290-
auto vehicle = reinterpret_cast<CClientVehicle*>(pOrigin);
5291-
pBitStream->WriteBit(1);
5292-
pBitStream->WriteBit(vehicleBlowState.value_or(vehicle->GetBlowState()) == VehicleBlowState::BLOWN);
5293-
}
5294-
else
5295-
{
5296-
pBitStream->WriteBit(0);
5297-
}
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);
52985288
}
52995289

53005290
// Convert position
@@ -5367,9 +5357,7 @@ void CClientGame::SendProjectileSync(CClientProjectile* pProjectile)
53675357
pBitStream->Write(&weaponTypeSync);
53685358

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

53745362
switch (weaponType)
53755363
{
@@ -6259,10 +6247,7 @@ void CClientGame::TakePlayerScreenShot(uint uiSizeX, uint uiSizeY, const SString
62596247
else
62606248
pBitStream->Write((uchar)EPlayerScreenShotResult::MINIMIZED);
62616249
pBitStream->Write(uiServerSentTime);
6262-
if (pBitStream->Version() >= 0x053)
6263-
pBitStream->Write(pResource->GetNetID());
6264-
else
6265-
pBitStream->WriteString(pResource->GetName());
6250+
pBitStream->Write(pResource->GetNetID());
62666251
pBitStream->WriteString(strTag);
62676252
g_pNet->SendPacket(PACKET_ID_PLAYER_SCREENSHOT, pBitStream, PACKET_PRIORITY_LOW, PACKET_RELIABILITY_RELIABLE_ORDERED, PACKET_ORDERING_DATA_TRANSFER);
62686253
g_pNet->DeallocateNetBitStream(pBitStream);
@@ -6327,13 +6312,9 @@ void CClientGame::GottenPlayerScreenShot(const CBuffer* pBuffer, uint uiTimeSpen
63276312
NetBitStreamInterface* pBitStream = g_pNet->AllocateNetBitStream();
63286313
pBitStream->Write((uchar)EPlayerScreenShotResult::ERROR_);
63296314
pBitStream->Write(uiServerGrabTime);
6330-
if (pBitStream->Version() >= 0x053)
6331-
pBitStream->Write(pResource->GetNetID());
6332-
else
6333-
pBitStream->WriteString(pResource->GetName());
6315+
pBitStream->Write(pResource->GetNetID());
63346316
pBitStream->WriteString(strTag);
6335-
if (pBitStream->Version() >= 0x053)
6336-
pBitStream->WriteString(strError);
6317+
pBitStream->WriteString(strError);
63376318
g_pNet->SendPacket(PACKET_ID_PLAYER_SCREENSHOT, pBitStream, PACKET_PRIORITY_LOW, PACKET_RELIABILITY_RELIABLE_ORDERED, PACKET_ORDERING_DATA_TRANSFER);
63386319
g_pNet->DeallocateNetBitStream(pBitStream);
63396320
return;
@@ -6373,10 +6354,7 @@ void CClientGame::GottenPlayerScreenShot(const CBuffer* pBuffer, uint uiTimeSpen
63736354
pBitStream->Write(uiServerGrabTime);
63746355
pBitStream->Write(uiTotalByteSize);
63756356
pBitStream->Write((ushort)uiNumParts);
6376-
if (pBitStream->Version() >= 0x053)
6377-
pBitStream->Write(pResource->GetNetID());
6378-
else
6379-
pBitStream->WriteString(pResource->GetName());
6357+
pBitStream->Write(pResource->GetNetID());
63806358
pBitStream->WriteString(strTag);
63816359
}
63826360

Client/mods/deathmatch/logic/CClientMarker.cpp

Lines changed: 34 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -410,28 +410,44 @@ void CClientMarker::StreamOut()
410410
}
411411
}
412412

413-
void CClientMarker::Callback_OnCollision(CClientColShape& Shape, CClientEntity& Entity)
413+
void CClientMarker::Callback_OnCollision(CClientColShape& shape, CClientEntity& entity)
414414
{
415-
if (IS_PLAYER(&Entity))
416-
{
417-
// Call the marker hit event
418-
CLuaArguments Arguments;
419-
Arguments.PushElement(&Entity); // player that hit it
420-
Arguments.PushBoolean((GetDimension() == Entity.GetDimension())); // matching dimension?
421-
CallEvent("onClientMarkerHit", Arguments, true);
422-
}
415+
if (GetInterior() != entity.GetInterior())
416+
return;
417+
418+
// Call the marker hit event
419+
CLuaArguments arguments;
420+
arguments.PushElement(&entity); // Hit element
421+
arguments.PushBoolean(GetDimension() == entity.GetDimension()); // Matching dimension?
422+
CallEvent("onClientMarkerHit", arguments, true);
423+
424+
if (!IS_PLAYER(&entity))
425+
return;
426+
427+
CLuaArguments arguments2;
428+
arguments2.PushElement(this); // marker
429+
arguments2.PushBoolean(GetDimension() == entity.GetDimension()); // Matching dimension?
430+
entity.CallEvent("onClientPlayerMarkerHit", arguments2, false);
423431
}
424432

425-
void CClientMarker::Callback_OnLeave(CClientColShape& Shape, CClientEntity& Entity)
433+
void CClientMarker::Callback_OnLeave(CClientColShape& shape, CClientEntity& entity)
426434
{
427-
if (IS_PLAYER(&Entity))
428-
{
429-
// Call the marker hit event
430-
CLuaArguments Arguments;
431-
Arguments.PushElement(&Entity); // player that hit it
432-
Arguments.PushBoolean((GetDimension() == Entity.GetDimension())); // matching dimension?
433-
CallEvent("onClientMarkerLeave", Arguments, true);
434-
}
435+
if (GetInterior() != entity.GetInterior())
436+
return;
437+
438+
// Call the marker leave event
439+
CLuaArguments arguments;
440+
arguments.PushElement(&entity); // Hit element
441+
arguments.PushBoolean(GetDimension() == entity.GetDimension()); // Matching dimension?
442+
CallEvent("onClientMarkerLeave", arguments, true);
443+
444+
if (!IS_PLAYER(&entity))
445+
return;
446+
447+
CLuaArguments arguments2;
448+
arguments2.PushElement(this); // marker
449+
arguments2.PushBoolean(GetDimension() == entity.GetDimension()); // Matching dimension?
450+
entity.CallEvent("onPlayerMarkerLeave", arguments2, false);
435451
}
436452

437453
void CClientMarker::CreateOfType(int iType)

Client/mods/deathmatch/logic/CClientPad.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -323,10 +323,10 @@ bool CClientPad::GetControlState(const char* szName, CControllerState& State, bo
323323
return State.LeftStickX == 128;
324324
break; // right
325325
case 7:
326-
return State.RightShoulder2 == 255;
326+
return State.LeftShoulder2 == 255;
327327
break; // zoom in
328328
case 8:
329-
return State.LeftShoulder2 == 255;
329+
return State.RightShoulder2 == 255;
330330
break; // zoom out
331331
case 9:
332332
return State.ButtonTriangle == 255; // enter_exit

0 commit comments

Comments
 (0)