recompute climbing damage

This commit is contained in:
explorer 2025-02-04 13:27:57 +03:00
parent 1fc61ba184
commit 31043114f0
3 changed files with 17 additions and 6 deletions

View File

@ -577,9 +577,7 @@ void __thiscall Redirected_Copy_Command(void* Unknown_Parameter, Command_Structu
if ((Infected ^ 1) + (Gender == 15) != 0)
{
using Get_Sequence_Name_Type = char*(__thiscall*)(void* Entity, __int32 Sequence);
if (__builtin_strstr(Get_Sequence_Name_Type((unsigned __int32)Client_Module + 203392)(Target->Self, *(__int32*)((unsigned __int32)Target->Self + 2212)), "hove") == nullptr)
if (__builtin_strstr(Get_Sequence_Name(Target->Self), "hove") == nullptr)
{
using Perform_Shove_Trace = __int8(__thiscall*)(void* Weapon, float* Direction);

View File

@ -1,3 +1,10 @@
char* Get_Sequence_Name(void* Entity)
{
using Get_Sequence_Name_Type = char*(__thiscall*)(void* Entity, __int32 Sequence);
return Get_Sequence_Name_Type((unsigned __int32)Client_Module + 203392)(Entity, *(__int32*)((unsigned __int32)Entity + 2212));
}
__int32 Get_Identifier(void* Entity, __int8 Raw, __int8 Equipment)
{
using Get_Identifier_Type = void*(__cdecl**)();
@ -27,9 +34,7 @@ __int32 Get_Identifier(void* Entity, __int8 Raw, __int8 Equipment)
{
if ((*(__int32*)((unsigned __int32)Entity + 572) - 131088 & 255) == 0)
{
using Get_Sequence_Name_Type = char*(__thiscall*)(void* Entity, __int32 Sequence);
if (__builtin_strstr(Get_Sequence_Name_Type((unsigned __int32)Client_Module + 203392)(Entity, *(__int32*)((unsigned __int32)Entity + 2212)), "eath") == nullptr)
if (__builtin_strstr(Get_Sequence_Name(Entity), "eath") == nullptr)
{
Valid = Identifier == 264 ? *(__int8*)((unsigned __int32)Entity + 4493) ^ 1 : 1;
}

View File

@ -285,6 +285,14 @@ void __thiscall Perform_Trace(void* Stack)
{
Damage = (__int32)(Damage + 1.f * (Damage < 1));
}
if (Identifier == 276)
{
if (__builtin_strstr(Get_Sequence_Name(Entity), "limb") != nullptr)
{
Damage = std::clamp(Damage, 0.f, *(__int32*)((unsigned __int32)Entity + 236) - 1.f);
}
}
}
}
}