Skip to content

Commit 398e61d

Browse files
committed
fixes
1 parent fce4740 commit 398e61d

9 files changed

Lines changed: 18 additions & 21 deletions

File tree

Amalgam/Amalgam.vcxproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1078,7 +1078,7 @@
10781078
<ClCompile Include="src\SDK\Helpers\TraceFilters\TraceFilters.cpp" />
10791079
<ClCompile Include="src\SDK\SDK.cpp" />
10801080
<ClCompile Include="src\SDK\Helpers\ConVars\ConVars.cpp" />
1081-
<ClCompile Include="src\Utils\ErrorLog\ErrorLog.cpp" />
1081+
<ClCompile Include="src\Utils\ExceptionHandler\ExceptionHandler.cpp" />
10821082
<ClCompile Include="src\Utils\Hooks\Hooks.cpp" />
10831083
<ClCompile Include="src\Utils\Interfaces\Interfaces.cpp" />
10841084
<ClCompile Include="src\Utils\KeyHandler\KeyHandler.cpp" />
@@ -1458,7 +1458,7 @@
14581458
<ClInclude Include="src\SDK\SDK.h" />
14591459
<ClInclude Include="src\SDK\Vars.h" />
14601460
<ClInclude Include="src\SDK\Helpers\ConVars\ConVars.h" />
1461-
<ClInclude Include="src\Utils\ErrorLog\ErrorLog.h" />
1461+
<ClInclude Include="src\Utils\ExceptionHandler\ExceptionHandler.h" />
14621462
<ClInclude Include="src\Utils\Macros\Macros.h" />
14631463
<ClInclude Include="src\Utils\Hash\FNV1A.h" />
14641464
<ClInclude Include="src\Utils\Hooks\Hooks.h" />

Amalgam/Amalgam.vcxproj.filters

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@
8282
<ClCompile Include="src\SDK\Definitions\Misc\ChecksumCRC.cpp" />
8383
<ClCompile Include="src\Hooks\Direct3DDevice9.cpp" />
8484
<ClCompile Include="src\SDK\Events\Events.cpp" />
85-
<ClCompile Include="src\Utils\ErrorLog\ErrorLog.cpp" />
85+
<ClCompile Include="src\Utils\ExceptionHandler\ExceptionHandler.cpp" />
8686
<ClCompile Include="src\BytePatches\BytePatches.cpp" />
8787
<ClCompile Include="include\ImGui\imgui_freetype.cpp" />
8888
<ClCompile Include="src\Features\Misc\AutoVote\AutoVote.cpp" />
@@ -458,7 +458,7 @@
458458
<ClInclude Include="src\SDK\Definitions\Main\CCaptureFlag.h" />
459459
<ClInclude Include="src\SDK\Definitions\Interfaces\IPanel.h" />
460460
<ClInclude Include="src\SDK\Definitions\Interfaces\CTFGCClientSystem.h" />
461-
<ClInclude Include="src\Utils\ErrorLog\ErrorLog.h" />
461+
<ClInclude Include="src\Utils\ExceptionHandler\ExceptionHandler.h" />
462462
<ClInclude Include="src\BytePatches\BytePatches.h" />
463463
<ClInclude Include="include\freetype\config\ftconfig.h" />
464464
<ClInclude Include="include\freetype\config\ftheader.h" />

Amalgam/src/DllMain.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
#include <Windows.h>
22
#include "Core/Core.h"
3-
#include "Utils/ErrorLog/ErrorLog.h"
3+
#include "Utils/ExceptionHandler/ExceptionHandler.h"
44

55
DWORD WINAPI MainThread(LPVOID lpParam)
66
{
7-
U::ErrorLog.Initialize(lpParam);
7+
U::ExceptionHandler.Initialize(lpParam);
88

99
U::Core.Load();
1010
U::Core.Loop();
1111
U::Core.Unload();
1212

13-
U::ErrorLog.Unload();
13+
U::ExceptionHandler.Unload();
1414

1515
FreeLibraryAndExitThread(static_cast<HMODULE>(lpParam), EXIT_SUCCESS);
1616
}

Amalgam/src/Features/Binds/Binds.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,8 @@ static inline void GetBinds(int iParent, CTFPlayer* pLocal, CTFWeaponBase* pWeap
125125

126126
if (tBind.m_bActive)
127127
{
128-
LoopVars(i, tBind.m_vVars);
129128
GetBinds(i, pLocal, pWeapon, vBinds, bManage);
129+
LoopVars(i, tBind.m_vVars);
130130
}
131131
}
132132
}

Amalgam/src/Features/ImGui/Menu/Components.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,7 @@ namespace ImGui
361361
return sText;
362362
}
363363

364-
inline std::string TruncateText(std::string sText, int iPixels, ImFont* pFont = nullptr, std::string sEnd = "...", size_t* pLength = nullptr)
364+
inline std::string TruncateText(const std::string& sText, int iPixels, ImFont* pFont = nullptr, const char* sEnd = "...", size_t* pLength = nullptr)
365365
{
366366
if (sText.empty())
367367
return "";
@@ -387,7 +387,7 @@ namespace ImGui
387387
return sTruncated;
388388
}
389389

390-
inline std::deque<std::string> WrapText(std::string sText, int iPixels, ImFont* pFont = nullptr)
390+
inline std::deque<std::string> WrapText(const std::string& sText, int iPixels, ImFont* pFont = nullptr)
391391
{
392392
if (sText.empty())
393393
return { "" };

Amalgam/src/Features/Visuals/Visuals.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,10 @@ void CVisuals::ProjectileTrace(CTFPlayer* pPlayer, CTFWeaponBase* pWeapon, const
7676
filter.pSkip = pPlayer;
7777
int nMask = MASK_SOLID;
7878
F::ProjSim.SetupTrace(filter, nMask, pWeapon, 0, bQuick);
79-
8079
Vec3* pNormal = nullptr;
81-
for (int n = 1; n <= TIME_TO_TICKS(tProjInfo.m_flLifetime); n++)
80+
81+
int iTicks = TIME_TO_TICKS(std::min(tProjInfo.m_flLifetime, 10.f));
82+
for (int n = 1; n <= iTicks; n++)
8283
{
8384
Vec3 Old = F::ProjSim.GetOrigin();
8485
F::ProjSim.RunTick(tProjInfo);

Amalgam/src/Utils/ErrorLog/ErrorLog.cpp renamed to Amalgam/src/Utils/ExceptionHandler/ExceptionHandler.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#include "ErrorLog.h"
1+
#include "ExceptionHandler.h"
22

33
#include "../../Features/Configs/Configs.h"
44

@@ -183,12 +183,12 @@ static LONG APIENTRY ExceptionFilter(PEXCEPTION_POINTERS ExceptionInfo)
183183
return EXCEPTION_EXECUTE_HANDLER;
184184
}
185185

186-
void CErrorLog::Initialize(LPVOID lpParam)
186+
void CExceptionHandler::Initialize(LPVOID lpParam)
187187
{
188188
s_pHandle = AddVectoredExceptionHandler(1, ExceptionFilter);
189189
s_lpParam = lpParam;
190190
}
191-
void CErrorLog::Unload()
191+
void CExceptionHandler::Unload()
192192
{
193193
RemoveVectoredExceptionHandler(s_pHandle);
194194
}

Amalgam/src/Utils/ErrorLog/ErrorLog.h renamed to Amalgam/src/Utils/ExceptionHandler/ExceptionHandler.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
#include "../Macros/Macros.h"
33
#include <Windows.h>
44

5-
class CErrorLog
5+
class CExceptionHandler
66
{
77
public:
88
void Initialize(LPVOID lpParam = nullptr);
99
void Unload();
1010
};
1111

12-
ADD_FEATURE_CUSTOM(CErrorLog, ErrorLog, U);
12+
ADD_FEATURE_CUSTOM(CExceptionHandler, ExceptionHandler, U);

Amalgam/src/Utils/Memory/Memory.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,6 @@
33
#include <format>
44
#include <Psapi.h>
55

6-
#define INRANGE(x, a, b) (x >= a && x <= b)
7-
#define GetBits(x) (INRANGE((x & (~0x20)),'A','F') ? ((x & (~0x20)) - 'A' + 0xA) : (INRANGE(x,'0','9') ? x - '0' : 0))
8-
#define GetBytes(x) (GetBits(x[0]) << 4 | GetBits(x[1]))
9-
106
std::vector<byte> CMemory::PatternToByte(const char* szPattern)
117
{
128
std::vector<byte> vPattern = {};

0 commit comments

Comments
 (0)