From 6554d9e04e26555576b261a27dfa030ad1e881bb Mon Sep 17 00:00:00 2001 From: explorer Date: Thu, 31 Oct 2024 13:33:26 +0300 Subject: [PATCH] CTerrorPlayer::IsInvulnerable embryo i'll get rid of server's timer eventually also there's bug (i'll take look on later) of "correction accumulation" on tickbase when server is paused which causes memory corruption --- Copy_Command.hpp | 2 +- Entry_Point.cpp | 4 ++++ Perform_Trace.hpp | 13 ++++++++++--- Set_Move_Type.hpp | 11 +++++++++++ Storm.vcxproj | 1 + Storm.vcxproj.filters | 3 +++ 6 files changed, 30 insertions(+), 4 deletions(-) create mode 100644 Set_Move_Type.hpp diff --git a/Copy_Command.hpp b/Copy_Command.hpp index 1f55866..e455b5e 100644 --- a/Copy_Command.hpp +++ b/Copy_Command.hpp @@ -180,7 +180,7 @@ void __thiscall Redirected_Copy_Command(void* Unknown_Parameter, Command_Structu void* Network_Channel = *(void**)(*(unsigned __int32*)((unsigned __int32)Engine_Module + 4352236) + 24); - auto Sequence_Shift = [&](__int32 Reserve) + auto Sequence_Shift = [&](__int32 Reserve) -> void { if (Extended_Commands[*(__int32*)((unsigned __int32)Local_Player + 20) % 150].Sequence_Shift == 0) { diff --git a/Entry_Point.cpp b/Entry_Point.cpp index e0ab08f..f9df895 100755 --- a/Entry_Point.cpp +++ b/Entry_Point.cpp @@ -18,6 +18,8 @@ void* Client_Module; #include "Post_Network_Data_Received.hpp" +#include "Set_Move_Type.hpp" + #include "Interpolate.hpp" #include "Update_Animations.hpp" @@ -190,6 +192,8 @@ __int32 __stdcall DllMain(HMODULE This_Module, unsigned __int32 Call_Reason, voi Byte_Manager::Set_Bytes(1, (void*)((unsigned __int32)Engine_Module + 350575), 1, 94); Byte_Manager::Set_Bytes(1, (void*)((unsigned __int32)Engine_Module + 521741), 1, 235); + + *(void**)((unsigned __int32)Client_Module + 7492840) = (void*)Redirected_Set_Move_Type; } _putws(L"[ + ] Interpolation"); diff --git a/Perform_Trace.hpp b/Perform_Trace.hpp index 6383b8b..1b61d61 100755 --- a/Perform_Trace.hpp +++ b/Perform_Trace.hpp @@ -102,7 +102,7 @@ void __thiscall Perform_Trace(void* Stack) { using Get_Difficulty_Type = __int32(__cdecl*)(); - float Multipliers[3] = { 0.8f, 0.7f, 0.6f }; + static float Multipliers[3] = { 0.8f, 0.7f, 0.6f }; Damage *= Multipliers[Get_Difficulty_Type((unsigned __int32)Client_Module + 2650448)()]; }; @@ -228,7 +228,14 @@ void __thiscall Perform_Trace(void* Stack) } else { - if (Identifier != 13) + if (Identifier == 13) + { + if (*(float*)((unsigned __int32)Entity + 336) - *(float*)((unsigned __int32)Entity + 472) < 0.5f) + { + Damage = 0; + } + } + else { if (Identifier + Bullet_Type == 284) { @@ -237,7 +244,7 @@ void __thiscall Perform_Trace(void* Stack) if ((Identifier != 276) + (Upgrade_Type != 1) == 2) { - float Multipliers[8] = { 1.f, 4.f, 1.f, 1.25f, 1.f, 1.f, 0.75f, 0.75f }; + static float Multipliers[8] = { 1.f, 4.f, 1.f, 1.25f, 1.f, 1.f, 0.75f, 0.75f }; Damage *= Multipliers[Group]; } diff --git a/Set_Move_Type.hpp b/Set_Move_Type.hpp new file mode 100644 index 0000000..66df9cf --- /dev/null +++ b/Set_Move_Type.hpp @@ -0,0 +1,11 @@ +void __cdecl Redirected_Set_Move_Type(void* Input, void* Output) +{ + if (*(__int8*)((unsigned __int32)Output + 324) == 0) + { + *(float*)((unsigned __int32)Output + 472) = *(float*)((unsigned __int32)Output + 336); + } + + *(__int8*)((unsigned __int32)Output + 324) = *(__int8*)((unsigned __int32)Input + 4); + + *(__int8*)((unsigned __int32)Output + 325) = 0; +} \ No newline at end of file diff --git a/Storm.vcxproj b/Storm.vcxproj index fc21b23..ec65ec8 100644 --- a/Storm.vcxproj +++ b/Storm.vcxproj @@ -84,6 +84,7 @@ + diff --git a/Storm.vcxproj.filters b/Storm.vcxproj.filters index 79f07ae..9ac7300 100644 --- a/Storm.vcxproj.filters +++ b/Storm.vcxproj.filters @@ -88,5 +88,8 @@ Header++ + + Header++ + \ No newline at end of file