Skip to content

Commit 5e20229

Browse files
authored
Merge branch 'master' into startstop
2 parents 22a2a6e + 924c920 commit 5e20229

File tree

103 files changed

+8908
-8985
lines changed

Some content is hidden

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

103 files changed

+8908
-8985
lines changed
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Crowdin Auto-Merge
2+
3+
on:
4+
schedule:
5+
- cron: '0 0 * * 5' # This cron expression runs the workflow every Friday at midnight (UTC)
6+
workflow_dispatch:
7+
8+
jobs:
9+
crowdin-auto-merge:
10+
if: github.event.repository.fork == false
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v4
15+
with:
16+
fetch-depth: 0
17+
18+
- name: Setup Git
19+
run: |
20+
git config --global user.name 'github-actions[bot]'
21+
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
22+
23+
- name: Auto-merge pull request
24+
run: |
25+
PR_NUMBER=$(gh pr list --repo ${{ github.repository }} --author 'MTABot' --base 'master' --head 'l10n/master' --state open --json number --jq '.[0].number')
26+
if [ -n "$PR_NUMBER" ]; then
27+
gh pr merge $PR_NUMBER --squash --repo ${{ github.repository }} --admin --subject "New Crowdin updates (PR #$PR_NUMBER)" --body ""
28+
git push origin --delete l10n/master
29+
fi
30+
env:
31+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/dockerimage.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ jobs:
2626
dockerfile: Dockerfile.armhf
2727
- tag: arm64
2828
dockerfile: Dockerfile.arm64
29+
if: github.event.repository.fork == false
2930
runs-on: ubuntu-latest
3031
steps:
3132
- uses: actions/checkout@v4

.github/workflows/rebuild-pots.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ on: [push, workflow_dispatch]
44

55
jobs:
66
test:
7+
if: github.event.repository.fork == false
78
runs-on: ubuntu-latest
89
steps:
910
- uses: actions/checkout@v4
@@ -23,6 +24,7 @@ jobs:
2324
run: pytest "utils/localization/tests"
2425
shell: bash -l {0}
2526
rebuild-pots:
27+
if: github.event.repository.fork == false
2628
runs-on: ubuntu-latest
2729
needs: test
2830
steps:

.github/workflows/stale.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ on:
66

77
jobs:
88
stale:
9+
if: github.event.repository.fork == false
910
runs-on: ubuntu-latest
1011
steps:
1112
- uses: multitheftauto/[email protected]

.github/workflows/sync-master-to-maetro.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ on:
77

88
jobs:
99
sync-master-to-maetro:
10+
if: github.event.repository.fork == false
1011
runs-on: ubuntu-latest
1112
steps:
1213
- uses: actions/checkout@v4

Client/core/CChat.cpp

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -650,7 +650,29 @@ bool CChat::CharacterKeyHandler(CGUIKeyEventArgs KeyboardArgs)
650650

651651
// If the input isn't empty and isn't identical to the previous entry in history, add it to the history
652652
if (!m_strInputText.empty() && (m_pInputHistory->Empty() || m_pInputHistory->GetLast() != m_strInputText))
653-
m_pInputHistory->Add(m_strInputText);
653+
{
654+
if (m_strCommand.empty() && m_strInputText[0] != '/')
655+
{
656+
// If the input is not a command, store it
657+
m_pInputHistory->Add(m_strInputText);
658+
}
659+
else if (m_strCommand.compare("login") != 0)
660+
{
661+
// If the input is a command, check that it isn't the 'login' command, if it is censor it
662+
char szInput[256];
663+
unsigned int uiLength = sizeof(szInput) - 1;
664+
665+
strncpy(szInput, m_strInputText.c_str() + 1, uiLength);
666+
szInput[uiLength] = '\0';
667+
668+
const char* szCommand = strtok(szInput, " ");
669+
670+
if (szCommand && (strcmp(szCommand, "login") != 0))
671+
m_pInputHistory->Add(m_strInputText);
672+
else if ((m_pInputHistory->Empty() || m_pInputHistory->GetLast() != std::string("/login")))
673+
m_pInputHistory->Add("/login");
674+
}
675+
}
654676

655677
SetInputVisible(false);
656678

Client/core/CVersionUpdater.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2770,7 +2770,7 @@ int CVersionUpdater::_PollDownload()
27702770
if (m_JobInfo.bShowDownloadPercent)
27712771
{
27722772
const bool bIsDownloadedSizeRight = m_JobInfo.uiBytesDownloaded > 0 && m_JobInfo.iFilesize >= m_JobInfo.uiBytesDownloaded;
2773-
const float fDownloadedPercent = bIsDownloadedSizeRight ? Round(m_JobInfo.uiBytesDownloaded / m_JobInfo.iFilesize * 100.f) : 0;
2773+
const int fDownloadedPercent = bIsDownloadedSizeRight ? Round((float)m_JobInfo.uiBytesDownloaded / m_JobInfo.iFilesize * 100.f) : 0;
27742774
GetQuestionBox().SetMessage(SString(_("%3d %% completed"), fDownloadedPercent));
27752775
}
27762776
if (m_JobInfo.iIdleTime > 1000 && m_JobInfo.iIdleTimeLeft > 500)
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
/*****************************************************************************
2+
*
3+
* PROJECT: Multi Theft Auto
4+
* LICENSE: See LICENSE in the top level directory
5+
* FILE: game_sa/CAEWeaponAudioEntitySA.h
6+
* PURPOSE: Weapon audio entity header
7+
*
8+
* Multi Theft Auto is available from https://www.multitheftauto.com/
9+
*
10+
*****************************************************************************/
11+
12+
#pragma once
13+
#include "CAudioEngineSA.h"
14+
15+
enum class eMiniGunState : std::uint8_t
16+
{
17+
SPINNING,
18+
FIRING,
19+
STOPPING,
20+
STOPPED,
21+
};
22+
23+
enum class eChainsawState : std::uint8_t
24+
{
25+
IDLE,
26+
ACTIVE,
27+
CUTTING,
28+
STOPPING,
29+
STOPPED,
30+
};
31+
32+
class CAEWeaponAudioEntitySAInterface : public CAEAudioEntity
33+
{
34+
public:
35+
bool m_isMiniGunSpinActive;
36+
bool m_isMiniGunFireActive;
37+
38+
std::uint8_t m_lastWeaponPlaneFrequencyIndex;
39+
40+
eMiniGunState m_miniGunState;
41+
eChainsawState m_chainsawState;
42+
43+
std::uint32_t m_lastFlamethrowerFireTimeInMS;
44+
std::uint32_t m_lastSpraycanFireTimeInMS;
45+
std::uint32_t m_lastFireExtinguisherFireTimeInMS;
46+
std::uint32_t m_lastMinigunFireTimeInMS;
47+
std::uint32_t m_lastChainsawFireTimeInMS;
48+
std::uint32_t m_lastGunFireTimeInMS;
49+
50+
CAESound* m_flameThrowerIdleGasLoopSound{};
51+
};
52+
static_assert(sizeof(CAEWeaponAudioEntitySAInterface) == 0xA0, "Invalid size for CAEWeaponAudioEntitySAInterface");

Client/game_sa/CBuildingRemovalSA.cpp

Lines changed: 48 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -54,15 +54,15 @@ void CBuildingRemovalSA::RemoveBuilding(uint16_t usModelToRemove, float fRange,
5454
if (pFind->m_iCount <= 0 && pFind->m_pInterface)
5555
{
5656
// Grab distances across each axis
57-
float fDistanceX = fX - pFind->m_pInterface->Placeable.m_transform.m_translate.fX;
58-
float fDistanceY = fY - pFind->m_pInterface->Placeable.m_transform.m_translate.fY;
59-
float fDistanceZ = fZ - pFind->m_pInterface->Placeable.m_transform.m_translate.fZ;
57+
float fDistanceX = fX - pFind->m_pInterface->m_transform.m_translate.fX;
58+
float fDistanceY = fY - pFind->m_pInterface->m_transform.m_translate.fY;
59+
float fDistanceZ = fZ - pFind->m_pInterface->m_transform.m_translate.fZ;
6060

61-
if (pFind->m_pInterface->Placeable.matrix != NULL)
61+
if (pFind->m_pInterface->matrix != NULL)
6262
{
63-
fDistanceX = fX - pFind->m_pInterface->Placeable.matrix->vPos.fX;
64-
fDistanceY = fY - pFind->m_pInterface->Placeable.matrix->vPos.fY;
65-
fDistanceZ = fZ - pFind->m_pInterface->Placeable.matrix->vPos.fZ;
63+
fDistanceX = fX - pFind->m_pInterface->matrix->vPos.fX;
64+
fDistanceY = fY - pFind->m_pInterface->matrix->vPos.fY;
65+
fDistanceZ = fZ - pFind->m_pInterface->matrix->vPos.fZ;
6666
}
6767

6868
// Square root 'em
@@ -80,7 +80,7 @@ void CBuildingRemovalSA::RemoveBuilding(uint16_t usModelToRemove, float fRange,
8080
if ((pInterface->nType == ENTITY_TYPE_BUILDING || pInterface->nType == ENTITY_TYPE_DUMMY || pInterface->nType == ENTITY_TYPE_OBJECT) &&
8181
pInterface->bRemoveFromWorld != 1)
8282
{
83-
if ((DWORD)(pInterface->vtbl) != VTBL_CPlaceable)
83+
if (!pInterface->IsPlaceableVTBL())
8484
{
8585
// Add the Data Building to the list
8686
pRemoval->AddDataBuilding(pInterface);
@@ -113,15 +113,15 @@ void CBuildingRemovalSA::RemoveBuilding(uint16_t usModelToRemove, float fRange,
113113
if (pFindBinary->m_iCount <= 0 && pFindBinary->m_pInterface)
114114
{
115115
// Grab distances across each axis
116-
float fDistanceX = fX - pFindBinary->m_pInterface->Placeable.m_transform.m_translate.fX;
117-
float fDistanceY = fY - pFindBinary->m_pInterface->Placeable.m_transform.m_translate.fY;
118-
float fDistanceZ = fZ - pFindBinary->m_pInterface->Placeable.m_transform.m_translate.fZ;
116+
float fDistanceX = fX - pFindBinary->m_pInterface->m_transform.m_translate.fX;
117+
float fDistanceY = fY - pFindBinary->m_pInterface->m_transform.m_translate.fY;
118+
float fDistanceZ = fZ - pFindBinary->m_pInterface->m_transform.m_translate.fZ;
119119

120-
if (pFindBinary->m_pInterface->Placeable.matrix != NULL)
120+
if (pFindBinary->m_pInterface->matrix != NULL)
121121
{
122-
fDistanceX = fX - pFindBinary->m_pInterface->Placeable.matrix->vPos.fX;
123-
fDistanceY = fY - pFindBinary->m_pInterface->Placeable.matrix->vPos.fY;
124-
fDistanceZ = fZ - pFindBinary->m_pInterface->Placeable.matrix->vPos.fZ;
122+
fDistanceX = fX - pFindBinary->m_pInterface->matrix->vPos.fX;
123+
fDistanceY = fY - pFindBinary->m_pInterface->matrix->vPos.fY;
124+
fDistanceZ = fZ - pFindBinary->m_pInterface->matrix->vPos.fZ;
125125
}
126126

127127
// Square root 'em
@@ -139,7 +139,7 @@ void CBuildingRemovalSA::RemoveBuilding(uint16_t usModelToRemove, float fRange,
139139
if ((pInterface->nType == ENTITY_TYPE_BUILDING || pInterface->nType == ENTITY_TYPE_DUMMY || pInterface->nType == ENTITY_TYPE_OBJECT) &&
140140
pInterface->bRemoveFromWorld != 1)
141141
{
142-
if ((DWORD)(pInterface->vtbl) != VTBL_CPlaceable)
142+
if (!pInterface->IsPlaceableVTBL())
143143
{
144144
// Add the Data Building to the list
145145
pRemoval->AddBinaryBuilding(pInterface);
@@ -211,7 +211,7 @@ bool CBuildingRemovalSA::RestoreBuilding(uint16_t usModelToRestore, float fRange
211211
pEntity->bRemoveFromWorld != 1)
212212
{
213213
// Don't call this on entities being removed.
214-
if ((DWORD)(pEntity->vtbl) != VTBL_CPlaceable)
214+
if (!pEntity->IsPlaceableVTBL())
215215
{
216216
pGame->GetWorld()->Add(pEntity, Building_Restore);
217217
m_pRemovedEntities[(DWORD)pEntity] = false;
@@ -243,7 +243,7 @@ bool CBuildingRemovalSA::RestoreBuilding(uint16_t usModelToRestore, float fRange
243243
if ((pEntity->nType == ENTITY_TYPE_BUILDING || pEntity->nType == ENTITY_TYPE_DUMMY || pEntity->nType == ENTITY_TYPE_OBJECT) &&
244244
pEntity->bRemoveFromWorld != 1)
245245
{
246-
if ((DWORD)(pEntity->vtbl) != VTBL_CPlaceable)
246+
if (!pEntity->IsPlaceableVTBL())
247247
{
248248
pGame->GetWorld()->Add(pEntity, Building_Restore2);
249249
m_pRemovedEntities[(DWORD)pEntity] = false;
@@ -277,15 +277,15 @@ bool CBuildingRemovalSA::RestoreBuilding(uint16_t usModelToRestore, float fRange
277277
if (pFound)
278278
{
279279
// Grab distances across each axis
280-
float fDistanceX = fX - pFound->m_pInterface->Placeable.m_transform.m_translate.fX;
281-
float fDistanceY = fY - pFound->m_pInterface->Placeable.m_transform.m_translate.fY;
282-
float fDistanceZ = fZ - pFound->m_pInterface->Placeable.m_transform.m_translate.fZ;
280+
float fDistanceX = fX - pFound->m_pInterface->m_transform.m_translate.fX;
281+
float fDistanceY = fY - pFound->m_pInterface->m_transform.m_translate.fY;
282+
float fDistanceZ = fZ - pFound->m_pInterface->m_transform.m_translate.fZ;
283283

284-
if (pFound->m_pInterface->Placeable.matrix != NULL)
284+
if (pFound->m_pInterface->matrix != NULL)
285285
{
286-
fDistanceX = fX - pFound->m_pInterface->Placeable.matrix->vPos.fX;
287-
fDistanceY = fY - pFound->m_pInterface->Placeable.matrix->vPos.fY;
288-
fDistanceZ = fZ - pFound->m_pInterface->Placeable.matrix->vPos.fZ;
286+
fDistanceX = fX - pFound->m_pInterface->matrix->vPos.fX;
287+
fDistanceY = fY - pFound->m_pInterface->matrix->vPos.fY;
288+
fDistanceZ = fZ - pFound->m_pInterface->matrix->vPos.fZ;
289289
}
290290

291291
// Square root 'em
@@ -309,15 +309,15 @@ bool CBuildingRemovalSA::RestoreBuilding(uint16_t usModelToRestore, float fRange
309309
if (pFoundBinary)
310310
{
311311
// Grab distances across each axis
312-
float fDistanceX = fX - pFoundBinary->m_pInterface->Placeable.m_transform.m_translate.fX;
313-
float fDistanceY = fY - pFoundBinary->m_pInterface->Placeable.m_transform.m_translate.fY;
314-
float fDistanceZ = fZ - pFoundBinary->m_pInterface->Placeable.m_transform.m_translate.fZ;
312+
float fDistanceX = fX - pFoundBinary->m_pInterface->m_transform.m_translate.fX;
313+
float fDistanceY = fY - pFoundBinary->m_pInterface->m_transform.m_translate.fY;
314+
float fDistanceZ = fZ - pFoundBinary->m_pInterface->m_transform.m_translate.fZ;
315315

316-
if (pFoundBinary->m_pInterface->Placeable.matrix != NULL)
316+
if (pFoundBinary->m_pInterface->matrix != NULL)
317317
{
318-
fDistanceX = fX - pFoundBinary->m_pInterface->Placeable.matrix->vPos.fX;
319-
fDistanceY = fY - pFoundBinary->m_pInterface->Placeable.matrix->vPos.fY;
320-
fDistanceZ = fZ - pFoundBinary->m_pInterface->Placeable.matrix->vPos.fZ;
318+
fDistanceX = fX - pFoundBinary->m_pInterface->matrix->vPos.fX;
319+
fDistanceY = fY - pFoundBinary->m_pInterface->matrix->vPos.fY;
320+
fDistanceZ = fZ - pFoundBinary->m_pInterface->matrix->vPos.fZ;
321321
}
322322

323323
// Square root 'em
@@ -386,15 +386,15 @@ bool CBuildingRemovalSA::IsObjectRemoved(CEntitySAInterface* pInterface)
386386
if (pFind->m_cInterior == -1 || pFind->m_cInterior == pInterface->m_areaCode)
387387
{
388388
// Grab the distance
389-
float fDistanceX = pFind->m_vecPos.fX - pInterface->Placeable.m_transform.m_translate.fX;
390-
float fDistanceY = pFind->m_vecPos.fY - pInterface->Placeable.m_transform.m_translate.fY;
391-
float fDistanceZ = pFind->m_vecPos.fZ - pInterface->Placeable.m_transform.m_translate.fZ;
389+
float fDistanceX = pFind->m_vecPos.fX - pInterface->m_transform.m_translate.fX;
390+
float fDistanceY = pFind->m_vecPos.fY - pInterface->m_transform.m_translate.fY;
391+
float fDistanceZ = pFind->m_vecPos.fZ - pInterface->m_transform.m_translate.fZ;
392392

393-
if (pInterface->Placeable.matrix != NULL)
393+
if (pInterface->matrix != NULL)
394394
{
395-
fDistanceX = pFind->m_vecPos.fX - pInterface->Placeable.matrix->vPos.fX;
396-
fDistanceY = pFind->m_vecPos.fY - pInterface->Placeable.matrix->vPos.fY;
397-
fDistanceZ = pFind->m_vecPos.fZ - pInterface->Placeable.matrix->vPos.fZ;
395+
fDistanceX = pFind->m_vecPos.fX - pInterface->matrix->vPos.fX;
396+
fDistanceY = pFind->m_vecPos.fY - pInterface->matrix->vPos.fY;
397+
fDistanceZ = pFind->m_vecPos.fZ - pInterface->matrix->vPos.fZ;
398398
}
399399

400400
float fDistance = sqrt(fDistanceX * fDistanceX + fDistanceY * fDistanceY + fDistanceZ * fDistanceZ);
@@ -457,7 +457,7 @@ void CBuildingRemovalSA::ClearRemovedBuildingLists(uint* pOutAmount)
457457
pEntity->bRemoveFromWorld != 1)
458458
{
459459
// Don't call this on entities being removed.
460-
if ((DWORD)(pEntity->vtbl) != VTBL_CPlaceable)
460+
if (!pEntity->IsPlaceableVTBL())
461461
{
462462
pGame->GetWorld()->Add(pEntity, BuildingRemovalReset);
463463
m_pRemovedEntities[(DWORD)pEntity] = false;
@@ -483,7 +483,7 @@ void CBuildingRemovalSA::ClearRemovedBuildingLists(uint* pOutAmount)
483483
pEntity->bRemoveFromWorld != 1)
484484
{
485485
// Don't call this on entities being removed.
486-
if ((DWORD)(pEntity->vtbl) != VTBL_CPlaceable)
486+
if (!pEntity->IsPlaceableVTBL())
487487
{
488488
pGame->GetWorld()->Add(pEntity, BuildingRemovalReset2);
489489
m_pRemovedEntities[(DWORD)pEntity] = false;
@@ -546,15 +546,15 @@ SBuildingRemoval* CBuildingRemovalSA::GetBuildingRemoval(CEntitySAInterface* pIn
546546
if (pFind)
547547
{
548548
// Grab the distance
549-
float fDistanceX = pFind->m_vecPos.fX - pInterface->Placeable.m_transform.m_translate.fX;
550-
float fDistanceY = pFind->m_vecPos.fY - pInterface->Placeable.m_transform.m_translate.fY;
551-
float fDistanceZ = pFind->m_vecPos.fZ - pInterface->Placeable.m_transform.m_translate.fZ;
549+
float fDistanceX = pFind->m_vecPos.fX - pInterface->m_transform.m_translate.fX;
550+
float fDistanceY = pFind->m_vecPos.fY - pInterface->m_transform.m_translate.fY;
551+
float fDistanceZ = pFind->m_vecPos.fZ - pInterface->m_transform.m_translate.fZ;
552552

553-
if (pInterface->Placeable.matrix != NULL)
553+
if (pInterface->matrix != NULL)
554554
{
555-
fDistanceX = pFind->m_vecPos.fX - pInterface->Placeable.matrix->vPos.fX;
556-
fDistanceY = pFind->m_vecPos.fY - pInterface->Placeable.matrix->vPos.fY;
557-
fDistanceZ = pFind->m_vecPos.fZ - pInterface->Placeable.matrix->vPos.fZ;
555+
fDistanceX = pFind->m_vecPos.fX - pInterface->matrix->vPos.fX;
556+
fDistanceY = pFind->m_vecPos.fY - pInterface->matrix->vPos.fY;
557+
fDistanceZ = pFind->m_vecPos.fZ - pInterface->matrix->vPos.fZ;
558558
}
559559

560560
float fDistance = sqrt(fDistanceX * fDistanceX + fDistanceY * fDistanceY + fDistanceZ * fDistanceZ);

0 commit comments

Comments
 (0)