stability

implementing logic for custom hitboxes isn't trivial, but at least to not crash; stumbled upon junk in `m_survivorCharacter` at `hehe30_9`. amend: finite checks
This commit is contained in:
explorer 2025-02-20 15:59:52 +03:00
parent 7070f6a68c
commit 404b3732e6
2 changed files with 112 additions and 108 deletions

View File

@ -802,6 +802,8 @@ void __thiscall Redirected_Copy_Command(void* Unknown_Parameter, Command_Structu
void* Hitbox = (void*)((unsigned __int32)Hitbox_Set + 12 + Hitboxes[Target->Identifier] * 68);
if (*(__int32*)Hitbox < sizeof(Bones) / sizeof(Bones[0]))
{
float* Hitbox_Minimum = (float*)((unsigned __int32)Hitbox + 8);
float* Hitbox_Maximum = (float*)((unsigned __int32)Hitbox + 20);
@ -855,6 +857,7 @@ void __thiscall Redirected_Copy_Command(void* Unknown_Parameter, Command_Structu
goto Aim_Found_Target_Label;
}
}
}
Target_Number += 1;

View File

@ -95,6 +95,8 @@ void __thiscall Redirected_Paint(void* Panel)
{
void* Hitbox = (void*)((unsigned __int32)Hitbox_Set + 12 + Hitbox_Number * 68);
if (*(__int32*)Hitbox < sizeof(Bones) / sizeof(Bones[0]))
{
float* Hitbox_Minimum = (float*)((unsigned __int32)Hitbox + 8);
float* Hitbox_Maximum = (float*)((unsigned __int32)Hitbox + 20);
@ -175,6 +177,7 @@ void __thiscall Redirected_Paint(void* Panel)
goto Get_Bounds_Label;
}
}
}
Bounds[0] -= 2.f;
@ -183,11 +186,9 @@ void __thiscall Redirected_Paint(void* Panel)
Bounds[2] -= 2.f;
Bounds[3] += 2.f;
return (Bounds[1] != 2.f) * (Bounds[3] != 2.f);
}
return 0;
return __builtin_isfinite(Bounds[0]) * (Bounds[1] != 2.f) * (Bounds[3] != 2.f);
};
if (Get_Bounds() == 1)
@ -242,7 +243,7 @@ void __thiscall Redirected_Paint(void* Panel)
{
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"Louis", (wchar_t*)L"Francis" };
Paint_Data->Name = Survivors[*(__int32*)((unsigned __int32)Target->Self + 7308) + 4 * (*(__int32*)((unsigned __int32)Client_Module + 8144624) == 1)];
Paint_Data->Name = Survivors[std::clamp(*(__int32*)((unsigned __int32)Target->Self + 7308), 0, 7) + 4 * (*(__int32*)((unsigned __int32)Client_Module + 8144624) == 1)];
}
__int8 Ghost = 0;