Skip to content

Commit d026afc

Browse files
committed
Revert "Merge remote-tracking branch 'upstream/master' into shadow"
This reverts commit fbad125, reversing changes made to 60e29ed.
1 parent fbad125 commit d026afc

Some content is hidden

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

70 files changed

+2317
-2782
lines changed

Client/core/CCommands.cpp

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,6 @@ bool CCommands::Execute(const char* szCommand, const char* szParametersIn, bool
125125

126126
// Grab the command
127127
tagCOMMANDENTRY* pEntry = Get(szCommand);
128-
bool wasHandled = false;
129128
if (pEntry)
130129
{
131130
// If its a core command, or if its enabled
@@ -134,16 +133,14 @@ bool CCommands::Execute(const char* szCommand, const char* szParametersIn, bool
134133
// Execute it
135134
if (!bIsScriptedBind || pEntry->bAllowScriptedBind)
136135
ExecuteHandler(pEntry->pfnCmdFunc, szParameters);
137-
138-
wasHandled = true;
136+
return true;
139137
}
140138
}
141139

142140
// Recompose the original command text
143141
std::string val = std::string(szCommand) + " " + std::string(szParameters ? szParameters : "");
144142

145143
// Is it a cvar? (syntax: cvar[ = value])
146-
if (!wasHandled)
147144
{
148145
// Check to see if '=' exists
149146
unsigned int nOpIndex = val.find('=');
@@ -191,7 +188,7 @@ bool CCommands::Execute(const char* szCommand, const char* szParametersIn, bool
191188

192189
// HACK: if its a 'nick' command, save it here
193190
bool bIsNickCommand = !stricmp(szCommand, "nick");
194-
if (!wasHandled && bIsNickCommand && szParameters && !bIsScriptedBind)
191+
if (bIsNickCommand && szParameters && !bIsScriptedBind)
195192
{
196193
if (CCore::GetSingleton().IsValidNick(szParameters))
197194
{
@@ -211,14 +208,10 @@ bool CCommands::Execute(const char* szCommand, const char* szParametersIn, bool
211208
// Try to execute the handler
212209
if (m_pfnExecuteHandler)
213210
{
214-
bool bAllowScriptedBind = (!pEntry || pEntry->bAllowScriptedBind);
215-
if (m_pfnExecuteHandler(szCommand, szParameters, bHandleRemotely, wasHandled, bIsScriptedBind, bAllowScriptedBind))
211+
if (m_pfnExecuteHandler(szCommand, szParameters, bHandleRemotely, (pEntry != NULL), bIsScriptedBind))
216212
return true;
217213
}
218214

219-
if (wasHandled)
220-
return true;
221-
222215
// Unknown command
223216
val = _("Unknown command or cvar: ") + szCommand;
224217
if (!bIsScriptedBind && !bIsNickCommand && pEntry == nullptr)

Client/core/CKeyBinds.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -841,8 +841,7 @@ CCommandBind* CKeyBinds::FindCommandMatch(const char* szKey, const char* szComma
841841
NullEmptyStrings(szKey, szArguments, szResource, szOriginalScriptKey);
842842

843843
std::string arguments = szArguments ? szArguments : "";
844-
if (!arguments.empty())
845-
szArguments = SharedUtil::Trim(arguments.data());
844+
szArguments = SharedUtil::Trim(arguments.data());
846845

847846
for (KeyBindPtr& bind : m_binds)
848847
{

Client/game_sa/CCameraSA.cpp

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -446,15 +446,15 @@ float CCameraSA::GetShakeForce()
446446

447447
void CCameraSA::ShakeCamera(float radius, float x, float y, float z) noexcept
448448
{
449-
static CCameraSAInterface* cameraInterface = GetInterface();
450-
if (radius <= 0.0f)
451-
return ResetShakeCamera();
452-
453-
using ShakeCamera_t = void(__thiscall*)(CCameraSAInterface*, float radius, float x, float y, float z);
454-
((ShakeCamera_t)FUNC_ShakeCam)(cameraInterface, radius, x, y, z);
455-
}
456-
457-
void CCameraSA::ResetShakeCamera() noexcept
458-
{
459-
GetInterface()->m_fCamShakeForce = 0.0f;
449+
DWORD dwFunc = FUNC_ShakeCam;
450+
CCameraSAInterface* cameraInterface = GetInterface();
451+
_asm
452+
{
453+
mov ecx, cameraInterface
454+
push z
455+
push y
456+
push x
457+
push radius
458+
call dwFunc
459+
}
460460
}

Client/game_sa/CCameraSA.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -429,5 +429,4 @@ class CCameraSA : public CCamera
429429
float GetShakeForce();
430430

431431
void ShakeCamera(float radius, float x, float y, float z) noexcept override;
432-
void ResetShakeCamera() noexcept override;
433432
};

Client/game_sa/CCarEnterExitSA.cpp

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -78,19 +78,6 @@ bool CCarEnterExitSA::GetNearestCarPassengerDoor(CPed* pPed, CVehicle* pVehicle,
7878
return bReturn;
7979
}
8080

81-
void CCarEnterExitSA::GetPositionToOpenCarDoor(CVector& position, CVehicle* vehicle, std::uint32_t door) const noexcept
82-
{
83-
CVehicleSA* vehicleSA = dynamic_cast<CVehicleSA*>(vehicle);
84-
85-
if (!vehicleSA)
86-
return;
87-
88-
CVehicleSAInterface* vehicleInterface = vehicleSA->GetVehicleInterface();
89-
90-
auto CCarEnterExit_GetPositionToOpenCarDoor = (void(__cdecl*)(CVector&, CVehicleSAInterface*, int))FUNC_GetPositionToOpenCarDoor;
91-
CCarEnterExit_GetPositionToOpenCarDoor(position, vehicleInterface, door);
92-
}
93-
9481
int CCarEnterExitSA::ComputeTargetDoorToExit(CPed* pPed, CVehicle* pVehicle)
9582
{
9683
DWORD dwFunc = FUNC_ComputeTargetDoorToExit;

Client/game_sa/CCarEnterExitSA.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,12 @@
1717
#define FUNC_GetNearestCarPassengerDoor 0x650BB0
1818
#define FUNC_ComputeTargetDoorToExit 0x64F110
1919
#define FUNC_IsRoomForPedToLeaveCar 0x6504C0
20-
#define FUNC_GetPositionToOpenCarDoor 0x64E740
2120

2221
class CCarEnterExitSA : public CCarEnterExit
2322
{
2423
public:
2524
bool GetNearestCarDoor(CPed* pPed, CVehicle* pVehicle, CVector* pVector, int* pDoor);
2625
bool GetNearestCarPassengerDoor(CPed* pPed, CVehicle* pVehicle, CVector* pVector, int* pDoor, bool bUnknown, bool bUnknown2, bool bCheckIfRoomToGetIn);
27-
void GetPositionToOpenCarDoor(CVector& position, CVehicle* vehicle, std::uint32_t door) const noexcept;
2826
int ComputeTargetDoorToExit(CPed* pPed, CVehicle* pVehicle);
2927
bool IsRoomForPedToLeaveCar(CVehicle* pVehicle, int iDoor, CVector* pUnknown = 0);
3028
};

Client/game_sa/CClockSA.cpp

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -30,19 +30,3 @@ void CClockSA::Get(BYTE* bHour, BYTE* bMinute)
3030
*bMinute = *(BYTE*)VAR_TimeMinutes;
3131
*bHour = *(BYTE*)VAR_TimeHours;
3232
}
33-
34-
bool CClockSA::SetTimeFrozen(bool value) noexcept
35-
{
36-
if (value)
37-
MemSet((void*)0x53BFBD, 0x90, 5);
38-
else
39-
MemCpy((void*)0x53BFBD, "\xE8\x4E\x0F\xFF\xFF", 5);
40-
41-
m_bTimeCycleFrozen = value;
42-
return true;
43-
}
44-
45-
bool CClockSA::ResetTimeFrozen() noexcept
46-
{
47-
return SetTimeFrozen(false);
48-
}

Client/game_sa/CClockSA.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,4 @@ class CClockSA : public CClock
2222
public:
2323
void Set(BYTE bHour, BYTE bMinute);
2424
void Get(BYTE* bHour, BYTE* bMinute);
25-
26-
bool SetTimeFrozen(bool value) noexcept;
27-
bool IsTimeFrozen() const noexcept { return m_bTimeCycleFrozen; };
28-
bool ResetTimeFrozen() noexcept;
29-
30-
private:
31-
bool m_bTimeCycleFrozen;
3225
};

Client/game_sa/CGameSA.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1005,14 +1005,18 @@ void CGameSA::GetShaderReplacementStats(SShaderReplacementStats& outStats)
10051005
m_pRenderWare->GetShaderReplacementStats(outStats);
10061006
}
10071007

1008-
void CGameSA::RemoveAllBuildings()
1008+
void CGameSA::RemoveAllBuildings(bool clearBuildingRemoval)
10091009
{
10101010
m_pIplStore->SetDynamicIplStreamingEnabled(false);
10111011

10121012
m_pPools->GetDummyPool().RemoveAllBuildingLods();
10131013
m_pPools->GetBuildingsPool().RemoveAllBuildings();
10141014

10151015
auto pBuildingRemoval = static_cast<CBuildingRemovalSA*>(m_pBuildingRemoval);
1016+
if (clearBuildingRemoval)
1017+
{
1018+
pBuildingRemoval->ClearRemovedBuildingLists();
1019+
}
10161020
pBuildingRemoval->DropCaches();
10171021

10181022
m_isBuildingsRemoved = true;
@@ -1032,7 +1036,7 @@ bool CGameSA::SetBuildingPoolSize(size_t size)
10321036
const bool shouldRemoveBuilding = !m_isBuildingsRemoved;
10331037
if (shouldRemoveBuilding)
10341038
{
1035-
RemoveAllBuildings();
1039+
RemoveAllBuildings(false);
10361040
}
10371041
else
10381042
{

Client/game_sa/CGameSA.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ class CGameSA : public CGame
303303
PostWeaponFireHandler* m_pPostWeaponFireHandler;
304304
TaskSimpleBeHitHandler* m_pTaskSimpleBeHitHandler;
305305

306-
void RemoveAllBuildings();
306+
void RemoveAllBuildings(bool clearBuildingRemoval = true);
307307
void RestoreGameBuildings();
308308

309309
bool SetBuildingPoolSize(size_t size);

0 commit comments

Comments
 (0)