autoshove during unholstering, use m_Gender instead of m_survivorCharacter

valve uses translator based on s_iSurvivorSet for m_survivorCharacter which is avoidable using m_Gender but potentially unsafe (on modded servers)
This commit is contained in:
explorer 2024-12-11 06:54:07 +03:00
parent 02e94e451c
commit 9efc44f17e
2 changed files with 6 additions and 4 deletions

View File

@ -379,6 +379,8 @@ void __thiscall Redirected_Copy_Command(void* Unknown_Parameter, Command_Structu
size_t Target_Number = 0; size_t Target_Number = 0;
__int8 Reloading = *(__int8*)((unsigned __int32)Weapon + 2493);
using Get_Weapon_Data_Type = void*(__thiscall*)(void* Weapon); using Get_Weapon_Data_Type = void*(__thiscall*)(void* Weapon);
void* Weapon_Data = Get_Weapon_Data_Type((unsigned __int32)Client_Module + 86432)(Weapon); void* Weapon_Data = Get_Weapon_Data_Type((unsigned __int32)Client_Module + 86432)(Weapon);
@ -411,7 +413,7 @@ void __thiscall Redirected_Copy_Command(void* Unknown_Parameter, Command_Structu
__int8 Forced = 0; __int8 Forced = 0;
if ((*(__int8*)((unsigned __int32)Weapon + 2493) + Is_Melee) * (Action + Reviving ^ 1) != 0) if ((Reloading + (*(__int32*)((unsigned __int32)Weapon + 2476) == 1276) + Is_Melee) * (Action + Reviving ^ 1) != 0)
{ {
if ((Target->Identifier ^ 72) % 348 >= 72) if ((Target->Identifier ^ 72) % 348 >= 72)
{ {
@ -516,7 +518,7 @@ void __thiscall Redirected_Copy_Command(void* Unknown_Parameter, Command_Structu
if (Cancelable_Shove != 0) if (Cancelable_Shove != 0)
{ {
__int8 Can_Attack = (*(float*)((unsigned __int32)Weapon + 2400) <= Global_Variables->Current_Time) * (*(__int32*)((unsigned __int32)Weapon + 2436) > 0 - Is_Melee * 2) * (*(__int8*)((unsigned __int32)Weapon + 2493) ^ 1) * (*(float*)((unsigned __int32)Local_Player + 3872) <= Global_Variables->Current_Time); __int8 Can_Attack = (*(float*)((unsigned __int32)Weapon + 2400) <= Global_Variables->Current_Time) * (*(__int32*)((unsigned __int32)Weapon + 2436) > 0 - Is_Melee * 2) * (Reloading ^ 1) * (*(float*)((unsigned __int32)Local_Player + 3872) <= Global_Variables->Current_Time);
if (Reviving + (Weapon_Identifier == 96) + (Can_Attack ^ 1) == 0) if (Reviving + (Weapon_Identifier == 96) + (Can_Attack ^ 1) == 0)
{ {

View File

@ -240,9 +240,9 @@ void __thiscall Redirected_Paint(void* Panel)
if (Target->Identifier == 232) if (Target->Identifier == 232)
{ {
static wchar_t* Survivors[8] = { (wchar_t*)L"Nick", (wchar_t*)L"Rochelle", (wchar_t*)L"Coach", (wchar_t*)L"Ellis", (wchar_t*)L"Bill", (wchar_t*)L"Zoey", (wchar_t*)L"Francis", (wchar_t*)L"Louis" }; static wchar_t* Survivors[8] = { (wchar_t*)L"Bill", (wchar_t*)L"Zoey", (wchar_t*)L"Francis", (wchar_t*)L"Louis", (wchar_t*)L"Nick", (wchar_t*)L"Rochelle", (wchar_t*)L"Coach", (wchar_t*)L"Ellis" };
Paint_Data->Name = Survivors[*(__int32*)((unsigned __int32)Target->Self + 7308)]; Paint_Data->Name = Survivors[*(__int32*)((unsigned __int32)Target->Self + 52) - 3];
} }
__int8 Ghost = 0; __int8 Ghost = 0;