Skip to content

Commit

Permalink
Merge branch 'master' into feature/prop-burnflippedcars
Browse files Browse the repository at this point in the history
  • Loading branch information
samr46 authored Apr 16, 2023
2 parents 5b366d6 + 57d5be3 commit 53f21d7
Show file tree
Hide file tree
Showing 89 changed files with 10,496 additions and 10,097 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/dockerimage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ on:
branches:
- master
paths:
- '.github/**'
- '.github/workflows/build.yaml'
- '.github/workflows/dockerimage.yaml'
- 'utils/compat/**'
- 'Dockerfile'
- 'Dockerfile.armhf'
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/rebuild-pots.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,14 @@ jobs:
if [[ $(git diff --unified=0 "Shared/data/MTA San Andreas/MTA/locale/en_US/client.pot" | grep -v POT-Creation-Date | grep '^[+|-][^+|-]') ]]
then
git add "Shared/data/MTA San Andreas/MTA/locale/en_US/client.pot"
git commit -m "Update client en_US pot"
git commit -m "Update client en_US pot" -m "[ci skip]"
fi
# Check that diff contains something and it's not only POT-Creation-Date
if [[ $(git diff --unified=0 "Shared/installer/locale/en_US.pot" | grep -v POT-Creation-Date | grep '^[+|-][^+|-]') ]]
then
git add "Shared/installer/locale/en_US.pot"
git commit -m "Update installer en_US pot"
git commit -m "Update installer en_US pot" -m "[ci skip]"
fi
# Check for local commits
Expand Down
40 changes: 40 additions & 0 deletions .github/workflows/sync-master-to-maetro.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: 'Sync master to maetro'

on:
push:
branches: [ master ]
workflow_dispatch:

jobs:
sync-master-to-maetro:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
token: ${{ secrets.SYNC_CI_PAT }}

- id: sync_commits
name: Sync commits
run: |
# GitHub Actions bot user
git config --global user.name "Mætro Bot"
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
git checkout release/maetro
if ! git merge master --ff --no-edit
then
# Discard locale conflicts
git checkout --ours -- Shared/installer/locale "Shared/data/MTA San Andreas/MTA/locale"
git add --verbose Shared/installer/locale "Shared/data/MTA San Andreas/MTA/locale"
# Discard install_cef.lua conflicts
git checkout --ours -- utils/buildactions/install_cef.lua
git add --verbose utils/buildactions/install_cef.lua
# We should be done with the merge now
git commit --no-edit
fi
git push origin release/maetro
2 changes: 1 addition & 1 deletion Client/core/CCore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1360,7 +1360,7 @@ void CCore::RegisterCommands()
m_pCommands->Add("jinglebells", "", CCommandFuncs::JingleBells);
m_pCommands->Add("fakelag", "", CCommandFuncs::FakeLag);

m_pCommands->Add("reloadnews", "for developers: reload news", CCommandFuncs::ReloadNews);
m_pCommands->Add("reloadnews", _("for developers: reload news"), CCommandFuncs::ReloadNews);
}

void CCore::SwitchRenderWindow(HWND hWnd, HWND hWndInput)
Expand Down
13 changes: 12 additions & 1 deletion Client/core/CCredits.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -255,33 +255,42 @@ CCredits::CCredits()
"\n"
"\n";

m_strCredits += _("This software makes use of the following libraries and software:");
m_strCredits += _("This software and project makes use of the following libraries and software:");
m_strCredits +=
"\n"
"1Password (https://1password.com/)\n"
"BASS (https://www.un4seen.com/bass.html)\n"
"bcrypt (https://www.openwall.com/crypt/)\n"
"breakpad (https://chromium.googlesource.com/breakpad/breakpad/)\n"
"bzip2 (http://www.bzip.org/)\n"
"CEF (https://bitbucket.org/chromiumembedded/cef/)\n"
"CEGUI (http://cegui.org.uk/)\n"
"Cloudflare (https://www.cloudflare.com/)\n"
"CRC-32 (https://bochs.sourceforge.io/)\n"
"Crowdin (https://crowdin.com/)\n"
"cryptopp (https://cryptopp.com/)\n"
"cURL (https://curl.se/)\n"
"Detours (https://github.com/microsoft/Detours)\n"
"Discord (https://discord.com/)\n"
"Docker (https://www.docker.com/)\n"
"Embedded HTTP Server (https://ehs.fritz-elfert.de/)\n"
"FreeType (https://freetype.org/)\n"
"inspect.lua by kikito (https://github.com/kikito/inspect.lua)\n"
"json-c (https://github.com/json-c/json-c)\n"
"GitBook (https://www.gitbook.com/)\n"
"GitHub (https://github.com/)\n"
"ksignals (https://github.com/xforce/ksignals)\n"
"libjpeg (https://libjpeg.sourceforge.net/)\n"
"libpcre (https://www.pcre.org/)\n"
"libpng (http://www.libpng.org/)\n"
"Lua (https://www.lua.org/)\n"
"lunasvg (https://github.com/sammycage/lunasvg)\n"
"mbedtls (https://github.com/Mbed-TLS/mbedtls)\n"
"MediaWiki (https://www.mediawiki.org/wiki/MediaWiki)\n"
"minizip (https://www.winimage.com/zLibDll/minizip.html)\n"
"mysql-connector-c (https://downloads.mysql.com/archives/c-c/)\n"
"nvapi (https://developer.nvidia.com/rtx/path-tracing/nvapi/get-started)\n"
"Open Collective (https://opencollective.com/)\n"
"pme by Zac Hansen\n"
"PortAudio (http://www.portaudio.com/)\n"
"pthreads-win32 (https://sourceware.org/pthreads-win32/)\n"
Expand All @@ -290,6 +299,8 @@ CCredits::CCredits()
"sparsehash (https://github.com/sparsehash/sparsehash)\n"
"speex (https://www.speex.org/)\n"
"SQLite (https://www.sqlite.org/)\n"
"TeamCity by JetBrains (https://www.jetbrains.com/teamcity/)\n"
"Teleport (https://goteleport.com/)\n"
"tinygettext (https://github.com/tinygettext/tinygettext/)\n"
"tinyxml (https://sourceforge.net/projects/tinyxml/)\n"
"UnRAR (https://www.rarlab.com/)\n"
Expand Down
4 changes: 2 additions & 2 deletions Client/core/CJoystickManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1202,7 +1202,7 @@ void CJoystickManager::SetDeadZone(int iDeadZone)
void CJoystickManager::SetSaturation(int iSaturation)
{
m_SettingsRevision++;
m_DevInfo.iSaturation = Clamp(51, iSaturation, 100);
m_DevInfo.iSaturation = Clamp(0, iSaturation, 100);
}

int CJoystickManager::GetSettingsRevision()
Expand Down Expand Up @@ -1388,7 +1388,7 @@ bool CJoystickManager::LoadFromXML()
iErrors++;

if (pA = pAttributes->Find("saturation"))
m_DevInfo.iSaturation = Clamp(51, atoi(pA->GetValue().c_str()), 100);
m_DevInfo.iSaturation = Clamp(0, atoi(pA->GetValue().c_str()), 100);
else
iErrors++;
}
Expand Down
5 changes: 3 additions & 2 deletions Client/core/CNewsBrowser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -168,9 +168,10 @@ void CNewsBrowser::CreateGUI()
m_pButtonOK->SetZOrderingEnabled(false);

// News link
float fNewsLinkButtonWidth = pManager->GetTextExtent(_("Visit latest news article"));
m_pButtonNewsLink = reinterpret_cast<CGUIButton*>(pManager->CreateButton(m_pWindow, _("Visit latest news article")));
m_pButtonNewsLink->SetSize(CVector2D(180, 40), false);
m_pButtonNewsLink->SetPosition(CVector2D(560.0f - 250, 480.0f - 30));
m_pButtonNewsLink->SetSize(CVector2D(60 + fNewsLinkButtonWidth, 40), false);
m_pButtonNewsLink->SetPosition(CVector2D(560.0f - 130 - fNewsLinkButtonWidth, 480.0f - 30));
m_pButtonNewsLink->SetZOrderingEnabled(false);

// Set up the events
Expand Down
6 changes: 3 additions & 3 deletions Client/core/ServerBrowser/CServerBrowser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -515,15 +515,15 @@ void CServerBrowser::CreateTab(ServerBrowserType type, const char* szName)
fX = fX + 20.0f + pManager->GetTextExtent(m_pIncludeLocked[type]->GetText().c_str()) + SB_SPACER;
m_pIncludeOffline[type] = reinterpret_cast<CGUICheckBox*>(pManager->CreateCheckBox(m_pTab[type], _("Offline"), true));
m_pIncludeOffline[type]->SetPosition(CVector2D(fX, fY), false);
m_pIncludeOffline[type]->AutoSize(m_pIncludeLocked[type]->GetText().c_str(), 20.0f);
m_pIncludeOffline[type]->AutoSize(m_pIncludeOffline[type]->GetText().c_str(), 20.0f);
m_pIncludeOffline[type]->SetClickHandler(GUI_CALLBACK(&CServerBrowser::OnFilterChanged, this));

fX = fX + 20.0f + pManager->GetTextExtent(m_pIncludeOffline[type]->GetText().c_str()) + SB_SPACER * 2;
fX = fX + 20.0f + pManager->GetTextExtent(m_pIncludeOffline[type]->GetText().c_str()) + SB_SPACER;
}
else
{
m_pIncludeOffline[type] = NULL;
fX = fX + 20.0f + pManager->GetTextExtent(m_pIncludeLocked[type]->GetText().c_str()) + SB_SPACER * 2;
fX = fX + 20.0f + pManager->GetTextExtent(m_pIncludeLocked[type]->GetText().c_str()) + SB_SPACER;
}

m_pIncludeOtherVersions[type] = reinterpret_cast<CGUICheckBox*>(pManager->CreateCheckBox(m_pTab[type], _("Other Versions"), false));
Expand Down
Binary file modified Client/launch/NEU/Multi Theft Auto.gdf.xml
Binary file not shown.
1 change: 1 addition & 0 deletions Client/mods/deathmatch/logic/CClientVehicle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3524,6 +3524,7 @@ void CClientVehicle::GetInitialDoorStates(SFixedArray<unsigned char, MAX_DOORS>&
case VT_RCTIGER:
case VT_TRACTOR:
case VT_VORTEX:
case VT_BLOODRA:
memset(&ucOutDoorStates[0], DT_DOOR_MISSING, MAX_DOORS);

// Keep the bonet and boot intact
Expand Down
3 changes: 3 additions & 0 deletions Client/mods/deathmatch/logic/CPacketHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2955,6 +2955,9 @@ void CPacketHandler::Packet_EntityAdd(NetBitStreamInterface& bitStream)
if (bitStream.ReadBit())
pObject->SetDoubleSided(true);

if (bitStream.Can(eBitStreamVersion::CEntityAddPacket_ObjectBreakable))
pObject->SetBreakable(bitStream.ReadBit());

if (bitStream.Can(eBitStreamVersion::DimensionOmnipresence))
if (bitStream.ReadBit())
pObject->SetVisibleInAllDimensions(true);
Expand Down
11 changes: 11 additions & 0 deletions Client/mods/deathmatch/logic/rpc/CObjectRPCs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ void CObjectRPCs::LoadFunctions()
AddHandler(STOP_OBJECT, StopObject, "StopObject");
AddHandler(SET_OBJECT_SCALE, SetObjectScale, "SetObjectScale");
AddHandler(SET_OBJECT_VISIBLE_IN_ALL_DIMENSIONS, SetObjectVisibleInAllDimensions, "SetObjectVisibleInAllDimensions");
AddHandler(SET_OBJECT_BREAKABLE, SetObjectBreakable, "SetObjectBreakable");
}

void CObjectRPCs::DestroyAllObjects(NetBitStreamInterface& bitStream)
Expand Down Expand Up @@ -115,3 +116,13 @@ void CObjectRPCs::SetObjectVisibleInAllDimensions(CClientEntity* pSource, NetBit
pObject->SetVisibleInAllDimensions(bVisible, usNewDimension);
}
}

void CObjectRPCs::SetObjectBreakable(CClientEntity* pSource, NetBitStreamInterface& bitStream)
{
CDeathmatchObject* pObject = static_cast<CDeathmatchObject*>(m_pObjectManager->Get(pSource->GetID()));

if (pObject)
{
pObject->SetBreakable(bitStream.ReadBit());
}
}
1 change: 1 addition & 0 deletions Client/mods/deathmatch/logic/rpc/CObjectRPCs.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,5 @@ class CObjectRPCs : public CRPCFunctions
DECLARE_ELEMENT_RPC(StopObject);
DECLARE_ELEMENT_RPC(SetObjectScale);
DECLARE_ELEMENT_RPC(SetObjectVisibleInAllDimensions);
DECLARE_ELEMENT_RPC(SetObjectBreakable);
};
11 changes: 11 additions & 0 deletions Client/multiplayer_sa/CMultiplayerSA.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1574,6 +1574,10 @@ void CMultiplayerSA::InitHooks()
// by skipping some entity flag check in CShadows::CastPlayerShadowSectorList()
MemSet((void*)0x70A4CB, 0x90, 6);

// Allow vertical camera movement during a camera fade (#411)
MemPut<BYTE>(0x524084, 0xFF);
MemPut<BYTE>(0x524089, 0xFF);

InitHooks_CrashFixHacks();

// Init our 1.3 hooks.
Expand Down Expand Up @@ -7138,11 +7142,18 @@ void _declspec(naked) HOOK_CCollision__CheckCameraCollisionObjects()
jz out2
movsx edx, word ptr [esi+22h]

// Store all registers
pushad

// Do our stuff
push esi // pEntity
call CanEntityCollideWithCamera
add esp, 4
test al, al

// Restore registers
popad

jnz out1
jmp RETURN_CCollision__CheckCameraCollisionObjects_2

Expand Down
2 changes: 1 addition & 1 deletion Server/mods/deathmatch/logic/CGame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1461,7 +1461,7 @@ void CGame::QuitPlayer(CPlayer& Player, CClient::eQuitReasons Reason, bool bSayI
const char* szNick = Player.GetNick();
if (bSayInConsole && szNick && szNick[0] && !m_bBeingDeleted)
{
CLogger::LogPrintf("QUIT: %s left the game [%s]%s\n", szNick, szReason, *Player.GetQuitReasonForLog());
CLogger::LogPrintf("QUIT: %s left the game [%s] %s\n", szNick, szReason, *Player.GetQuitReasonForLog());
}

// If he had joined
Expand Down
3 changes: 3 additions & 0 deletions Server/mods/deathmatch/logic/CObject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,9 @@ bool CObject::ReadSpecialData(const int iLine)

GetCustomDataBool("frozen", m_bIsFrozen, true);

if (!GetCustomDataBool("breakable", m_bBreakable, true))
m_bBreakable = CObjectManager::IsBreakableModel(m_usModel);

return true;
}

Expand Down
3 changes: 3 additions & 0 deletions Server/mods/deathmatch/logic/CObject.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,9 @@ class CObject : public CElement
bool IsVisibleInAllDimensions() { return m_bVisibleInAllDimensions; };
void SetVisibleInAllDimensions(bool bVisible) { m_bVisibleInAllDimensions = bVisible; };

bool IsBreakable() { return m_bBreakable; }
void SetBreakable(bool bBreakable) { m_bBreakable = bBreakable; }

protected:
bool ReadSpecialData(const int iLine) override;

Expand Down
1 change: 1 addition & 0 deletions Server/mods/deathmatch/logic/CPerfStat.RPCPacketUsage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,7 @@ ADD_ENUM1(REMOVE_COLPOLYGON_POINT)
ADD_ENUM1(UPDATE_COLPOLYGON_POINT)
ADD_ENUM1(SET_DISCORD_JOIN_PARAMETERS)
ADD_ENUM1(SET_COLPOLYGON_HEIGHT)
ADD_ENUM1(SET_OBJECT_BREAKABLE)
IMPLEMENT_ENUM_END("eElementRPCFunctions")

DECLARE_ENUM(CRPCFunctions::eRPCFunctions);
Expand Down
4 changes: 4 additions & 0 deletions Server/mods/deathmatch/logic/CPlayer.h
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,9 @@ class CPlayer final : public CPed, public CClient
void SetLeavingServer(bool bLeaving) noexcept { m_bIsLeavingServer = bLeaving; }
bool IsLeavingServer() const noexcept { return m_bIsLeavingServer; }

void SetRedirecting(bool bRedirecting) noexcept { m_bIsRedirecting = bRedirecting; }
bool IsRedirecting() const noexcept { return m_bIsRedirecting; }

protected:
bool ReadSpecialData(const int iLine) override { return true; }

Expand Down Expand Up @@ -359,6 +362,7 @@ class CPlayer final : public CPed, public CClient
CMtaVersion m_strPlayerVersion;
bool m_bIsMuted;
bool m_bIsLeavingServer;
bool m_bIsRedirecting;
bool m_bIsJoined;

bool m_bNametagColorOverridden;
Expand Down
Loading

0 comments on commit 53f21d7

Please sign in to comment.