Skip to content

Commit c905a3d

Browse files
authored
Merge branch 'master' into feature/2dfx
2 parents 3f687cc + d01df35 commit c905a3d

File tree

15 files changed

+947
-920
lines changed

15 files changed

+947
-920
lines changed

Client/cefweb/CWebCore.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ bool CWebCore::Initialise()
7171
#else
7272
CefString(&settings.browser_subprocess_path).FromWString(FromUTF8(CalcMTASAPath("MTA\\CEF\\CEFLauncher_d.exe")));
7373
#endif
74-
CefString(&settings.resources_dir_path).FromWString(FromUTF8(CalcMTASAPath("MTA\\CEF")));
7574
CefString(&settings.cache_path).FromWString(FromUTF8(CalcMTASAPath("MTA\\CEF\\cache")));
7675
CefString(&settings.locales_dir_path).FromWString(FromUTF8(CalcMTASAPath("MTA\\CEF\\locales")));
7776
CefString(&settings.log_file).FromWString(FromUTF8(CalcMTASAPath("MTA\\CEF\\cefdebug.txt")));

Client/core/CCore.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1869,6 +1869,13 @@ void CCore::RecalculateFrameRateLimit(uint uiServerFrameRateLimit, bool bLogToCo
18691869
if ((m_uiFrameRateLimit == 0 || uiClientScriptRate < m_uiFrameRateLimit) && uiClientScriptRate > 0)
18701870
m_uiFrameRateLimit = uiClientScriptRate;
18711871

1872+
// Removes Limiter from Frame Graph if limit is zero and skips frame limit
1873+
if (m_uiFrameRateLimit == 0)
1874+
{
1875+
m_bQueuedFrameRateValid = false;
1876+
GetGraphStats()->RemoveTimingPoint("Limiter");
1877+
}
1878+
18721879
// Print new limits to the console
18731880
if (bLogToConsole)
18741881
{

Client/core/CGraphStats.cpp

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ class CGraphStats : public CGraphStatsInterface
3939
virtual void SetEnabled(bool bEnabled);
4040
virtual bool IsEnabled();
4141
virtual void AddTimingPoint(const char* szName);
42+
virtual void RemoveTimingPoint(const char* szName);
4243

4344
protected:
4445
bool m_bEnabled;
@@ -189,6 +190,21 @@ void CGraphStats::AddTimingPoint(const char* szName)
189190
pLine->dataHistory[pLine->iDataPos] = AvgData;
190191
}
191192

193+
///////////////////////////////////////////////////////////////
194+
//
195+
// CGraphStats::RemoveTimingPoint
196+
//
197+
//
198+
//
199+
///////////////////////////////////////////////////////////////
200+
void CGraphStats::RemoveTimingPoint(const char* szName)
201+
{
202+
if (!IsEnabled() || szName[0] == 0)
203+
return;
204+
205+
MapRemove(m_LineList, szName);
206+
}
207+
192208
///////////////////////////////////////////////////////////////
193209
//
194210
// CGraphStats::Draw

Client/core/CGraphStats.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ class CGraphStatsInterface
2323
virtual void SetEnabled(bool bEnabled) = 0;
2424
virtual bool IsEnabled() = 0;
2525
virtual void AddTimingPoint(const char* szName) = 0;
26+
virtual void RemoveTimingPoint(const char* szName) = 0;
2627
};
2728

2829
CGraphStatsInterface* GetGraphStats();

Client/core/CVersionUpdater.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1912,7 +1912,7 @@ void CVersionUpdater::_DialogUpdateQueryError()
19121912
// Display message
19131913
GetQuestionBox().Reset();
19141914
GetQuestionBox().SetTitle(_("UPDATE CHECK"));
1915-
GetQuestionBox().SetMessage(_("Update not currently avalable.\n\nPlease check www.mtasa.com"));
1915+
GetQuestionBox().SetMessage(_("An update is currently not available.\n\nPlease check www.mtasa.com"));
19161916
GetQuestionBox().SetButton(0, _("OK"));
19171917
GetQuestionBox().Show();
19181918
_PollAnyButton();

Client/game_sa/CEntitySA.cpp

Lines changed: 67 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -606,101 +606,94 @@ bool CEntitySA::GetBoneRotation(eBone boneId, float& yaw, float& pitch, float& r
606606
bool CEntitySA::GetBoneRotationQuat(eBone boneId, float& x, float& y, float& z, float& w)
607607
{
608608
RpClump* clump = GetRpClump();
609-
if (clump)
610-
{
611-
// updating the bone frame orientation will also update its children
612-
// This rotation is only applied when UpdateElementRpHAnim is called
613-
CAnimBlendClumpDataSAInterface* clumpDataInterface = *pGame->GetClumpData(clump);
614-
AnimBlendFrameData* frameData = clumpDataInterface->GetFrameDataByNodeId(boneId);
615-
if (frameData)
616-
{
617-
RtQuat* boneOrientation = &frameData->m_pIFrame->orientation;
618-
x = boneOrientation->imag.x;
619-
y = boneOrientation->imag.y;
620-
z = boneOrientation->imag.z;
621-
w = boneOrientation->real;
622-
return true;
623-
}
624-
}
625-
return false;
609+
if (!clump)
610+
return false;
611+
612+
// updating the bone frame orientation will also update its children
613+
// This rotation is only applied when UpdateElementRpHAnim is called
614+
auto* clumpDataInterface = *pGame->GetClumpData(clump);
615+
auto* frameData = clumpDataInterface->GetFrameDataByNodeId(boneId);
616+
if (!frameData)
617+
return false;
618+
619+
RtQuat* boneOrientation = &frameData->m_pIFrame->orientation;
620+
x = boneOrientation->imag.x;
621+
y = boneOrientation->imag.y;
622+
z = boneOrientation->imag.z;
623+
w = boneOrientation->real;
624+
return true;
626625
}
627626

628627
bool CEntitySA::SetBoneRotation(eBone boneId, float yaw, float pitch, float roll)
629628
{
630629
RpClump* clump = GetRpClump();
631-
if (clump)
632-
{
633-
// updating the bone frame orientation will also update its children
634-
// This rotation is only applied when UpdateElementRpHAnim is called
635-
CAnimBlendClumpDataSAInterface* clumpDataInterface = *pGame->GetClumpData(clump);
636-
AnimBlendFrameData* frameData = clumpDataInterface->GetFrameDataByNodeId(boneId);
637-
if (frameData)
638-
{
639-
RtQuat* boneOrientation = &frameData->m_pIFrame->orientation;
640-
RwV3d angles = {yaw, roll, pitch};
641-
BoneNode_cSAInterface::EulerToQuat(&angles, boneOrientation);
642-
CEntitySAInterface* theInterface = GetInterface();
643-
if (theInterface)
644-
{
645-
theInterface->bDontUpdateHierarchy = false;
646-
}
647-
return true;
648-
}
649-
}
650-
return false;
630+
if (!clump)
631+
return false;
632+
633+
// updating the bone frame orientation will also update its children
634+
// This rotation is only applied when UpdateElementRpHAnim is called
635+
auto* clumpDataInterface = *pGame->GetClumpData(clump);
636+
auto* frameData = clumpDataInterface->GetFrameDataByNodeId(boneId);
637+
if (!frameData)
638+
return false;
639+
640+
RtQuat* boneOrientation = &frameData->m_pIFrame->orientation;
641+
RwV3d angles = { yaw, roll, pitch };
642+
BoneNode_cSAInterface::EulerToQuat(&angles, boneOrientation);
643+
CEntitySAInterface* theInterface = GetInterface();
644+
if (theInterface)
645+
theInterface->bDontUpdateHierarchy = false;
646+
647+
return true;
651648
}
652649

653650
bool CEntitySA::SetBoneRotationQuat(eBone boneId, float x, float y, float z, float w)
654651
{
655652
RpClump* clump = GetRpClump();
656-
if (clump)
657-
{
658-
// updating the bone frame orientation will also update its children
659-
// This rotation is only applied when UpdateElementRpHAnim is called
660-
CAnimBlendClumpDataSAInterface* clumpDataInterface = *pGame->GetClumpData(clump);
661-
AnimBlendFrameData* frameData = clumpDataInterface->GetFrameDataByNodeId(boneId);
662-
if (frameData)
663-
{
664-
RtQuat* boneOrientation = &frameData->m_pIFrame->orientation;
665-
boneOrientation->imag.x = x;
666-
boneOrientation->imag.y = y;
667-
boneOrientation->imag.z = z;
668-
boneOrientation->real = w;
669-
CEntitySAInterface* theInterface = GetInterface();
670-
if (theInterface)
671-
{
672-
theInterface->bDontUpdateHierarchy = false;
673-
}
674-
return true;
675-
}
676-
}
677-
return false;
653+
if (!clump)
654+
return false;
655+
656+
// updating the bone frame orientation will also update its children
657+
// This rotation is only applied when UpdateElementRpHAnim is called
658+
auto* clumpDataInterface = *pGame->GetClumpData(clump);
659+
auto* frameData = clumpDataInterface->GetFrameDataByNodeId(boneId);
660+
if (!frameData)
661+
return false;
662+
663+
RtQuat* boneOrientation = &frameData->m_pIFrame->orientation;
664+
boneOrientation->imag.x = x;
665+
boneOrientation->imag.y = y;
666+
boneOrientation->imag.z = z;
667+
boneOrientation->real = w;
668+
CEntitySAInterface* theInterface = GetInterface();
669+
if (theInterface)
670+
theInterface->bDontUpdateHierarchy = false;
671+
672+
return true;
678673
}
679674

680675
bool CEntitySA::GetBonePosition(eBone boneId, CVector& position)
681676
{
682677
RwMatrix* rwBoneMatrix = GetBoneRwMatrix(boneId);
683-
if (rwBoneMatrix)
684-
{
685-
const RwV3d& pos = rwBoneMatrix->pos;
686-
position = {pos.x, pos.y, pos.z};
687-
return true;
688-
}
689-
return false;
678+
if (!rwBoneMatrix)
679+
return false;
680+
681+
const RwV3d& pos = rwBoneMatrix->pos;
682+
position = {pos.x, pos.y, pos.z};
683+
return true;
690684
}
691685

692686
// NOTE: The position will be reset if UpdateElementRpHAnim is called after this.
693687
bool CEntitySA::SetBonePosition(eBone boneId, const CVector& position)
694688
{
695689
RwMatrix* rwBoneMatrix = GetBoneRwMatrix(boneId);
696-
if (rwBoneMatrix)
697-
{
698-
CMatrixSAInterface boneMatrix(rwBoneMatrix, false);
699-
boneMatrix.SetTranslateOnly(position);
700-
boneMatrix.UpdateRW();
701-
return true;
702-
}
703-
return false;
690+
if (!rwBoneMatrix)
691+
return false;
692+
693+
CMatrixSAInterface boneMatrix(rwBoneMatrix, false);
694+
boneMatrix.SetTranslateOnly(position);
695+
boneMatrix.UpdateRW();
696+
return true;
704697
}
705698

706699
BYTE CEntitySA::GetAreaCode()

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

Lines changed: 24 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1003,22 +1003,26 @@ int CLuaPedDefs::CanPedBeKnockedOffBike(lua_State* luaVM)
10031003
bool CLuaPedDefs::SetElementBonePosition(lua_State* const luaVM, CClientPed* entity, std::uint32_t boneId, CVector position)
10041004
{
10051005
CEntity* theEntity = entity->GetGameEntity();
1006-
return theEntity ? theEntity->SetBonePosition(static_cast<eBone>(boneId), position) : false;
1006+
if (!theEntity)
1007+
return false;
1008+
return theEntity->SetBonePosition(static_cast<eBone>(boneId), position);
10071009
}
10081010

10091011
bool CLuaPedDefs::SetElementBoneRotation(lua_State* const luaVM, CClientPed* entity, std::uint32_t boneId, float yaw, float pitch, float roll)
10101012
{
10111013
if (boneId > BONE_RIGHTFOOT)
1012-
throw LuaFunctionError("Invalid bone ID");
1014+
throw LuaFunctionError("Invalid bone ID", false);
10131015

10141016
CEntity* theEntity = entity->GetGameEntity();
1015-
return theEntity ? theEntity->SetBoneRotation(static_cast<eBone>(boneId), yaw, pitch, roll) : false;
1017+
if (!theEntity)
1018+
return false;
1019+
return theEntity->SetBoneRotation(static_cast<eBone>(boneId), yaw, pitch, roll);
10161020
}
10171021

10181022
bool CLuaPedDefs::SetElementBoneQuaternion(lua_State* const luaVM, CClientPed* entity, std::uint32_t boneId, float x, float y, float z, float w)
10191023
{
10201024
if (boneId > BONE_RIGHTFOOT)
1021-
throw LuaFunctionError("Invalid bone ID");
1025+
throw LuaFunctionError("Invalid bone ID", false);
10221026

10231027
CEntity* theEntity = entity->GetGameEntity();
10241028
return theEntity ? theEntity->SetBoneRotationQuat(static_cast<eBone>(boneId), x, y, z, w) : false;
@@ -1028,33 +1032,36 @@ std::variant<bool, CLuaMultiReturn<float, float, float>> CLuaPedDefs::GetElement
10281032
{
10291033
CEntity* theEntity = entity->GetGameEntity();
10301034
CVector position;
1031-
if (theEntity && theEntity->GetBonePosition(static_cast<eBone>(boneId), position))
1032-
return std::make_tuple(position.fX, position.fY, position.fZ);
1033-
return false;
1035+
if (!theEntity || !theEntity->GetBonePosition(static_cast<eBone>(boneId), position))
1036+
return false;
1037+
1038+
return std::make_tuple(position.fX, position.fY, position.fZ);
10341039
}
10351040

10361041
std::variant<bool, CLuaMultiReturn<float, float, float>> CLuaPedDefs::GetElementBoneRotation(lua_State* const luaVM, CClientPed* entity, std::uint32_t boneId)
10371042
{
10381043
if (boneId > BONE_RIGHTFOOT)
1039-
throw LuaFunctionError("Invalid bone ID");
1044+
throw LuaFunctionError("Invalid bone ID", false);
10401045

1041-
float yaw = 0.0f, pitch = 0.0f, roll = 0.0f;
1046+
float yaw = 0.0f, pitch = 0.0f, roll = 0.0f;
10421047
CEntity* theEntity = entity->GetGameEntity();
1043-
if (theEntity && theEntity->GetBoneRotation(static_cast<eBone>(boneId), yaw, pitch, roll))
1044-
return std::make_tuple(yaw, pitch, roll);
1045-
return false;
1048+
if (!theEntity || !theEntity->GetBoneRotation(static_cast<eBone>(boneId), yaw, pitch, roll))
1049+
return false;
1050+
1051+
return std::make_tuple(yaw, pitch, roll);
10461052
}
10471053

10481054
std::variant<bool, CLuaMultiReturn<float, float, float, float>> CLuaPedDefs::GetElementBoneQuaternion(lua_State* const luaVM, CClientPed* entity, std::uint32_t boneId)
10491055
{
10501056
if (boneId > BONE_RIGHTFOOT)
1051-
throw LuaFunctionError("Invalid bone ID");
1057+
throw LuaFunctionError("Invalid bone ID", false);
10521058

1053-
float x = 0.0f, y = 0.0f, z = 0.0f, w = 0.0f;
1059+
float x = 0.0f, y = 0.0f, z = 0.0f, w = 0.0f;
10541060
CEntity* theEntity = entity->GetGameEntity();
1055-
if (theEntity && theEntity->GetBoneRotationQuat(static_cast<eBone>(boneId), x, y, z, w))
1056-
return std::make_tuple(x, y, z, w);
1057-
return false;
1061+
if (!theEntity || !theEntity->GetBoneRotationQuat(static_cast<eBone>(boneId), x, y, z, w))
1062+
return false;
1063+
1064+
return std::make_tuple(x, y, z, w);
10581065
}
10591066

10601067
bool CLuaPedDefs::SetElementBoneMatrix(lua_State* const luaVM, CClientPed* entity, std::uint32_t boneId, CMatrix boneMatrix)

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
## Multi Theft Auto: San Andreas
1+
## Multi Theft Auto: San Andreas
22

33
[![Build Status](https://github.com/multitheftauto/mtasa-blue/workflows/Build/badge.svg?event=push&branch=master)](https://github.com/multitheftauto/mtasa-blue/actions?query=branch%3Amaster+event%3Apush) [![Unique servers online](https://img.shields.io/endpoint?url=https%3A%2F%2Fmultitheftauto.com%2Fapi%2Fservers-shields.io.json)](https://community.multitheftauto.com/index.php?p=servers) [![Unique players online](https://img.shields.io/endpoint?url=https%3A%2F%2Fmultitheftauto.com%2Fapi%2Fplayers-shields.io.json)](https://multitheftauto.com) [![Unique players last 24 hours](https://img.shields.io/endpoint?url=https%3A%2F%2Fmultitheftauto.com%2Fapi%2Funique-players-shields.io.json)](https://multitheftauto.com) [![Discord](https://img.shields.io/discord/278474088903606273?label=discord&logo=discord)](https://discord.com/invite/mtasa) [![Crowdin](https://badges.crowdin.net/e/f5dba7b9aa6594139af737c85d81d3aa/localized.svg)](https://multitheftauto.crowdin.com/multitheftauto)
44

Server/mods/deathmatch/logic/CResource.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3011,7 +3011,7 @@ HttpStatusCode CResource::HandleRequestRouter(HttpRequest* request, HttpResponse
30113011
luaRequest.PushString("path");
30123012
luaRequest.PushString(path);
30133013

3014-
luaRequest.PushString("absolute_path");
3014+
luaRequest.PushString("absolutePath");
30153015
luaRequest.PushString(request->sOriginalUri);
30163016

30173017
luaRequest.PushString("hostname");

0 commit comments

Comments
 (0)