mirror of
https://github.com/rei-kes/Amalgam.git
synced 2025-06-12 21:59:17 +08:00
Fix a crash relating to SetAlphaModulation
This commit is contained in:
parent
0f511b7f24
commit
52619df35e
@ -3,8 +3,20 @@
|
||||
MAKE_HOOK(StudioRender_SetAlphaModulation, U::Memory.GetVFunc(I::StudioRender, 28), void, __fastcall,
|
||||
void* ecx, float flAlpha)
|
||||
{
|
||||
if (Vars::Visuals::World::Modulations.Value & (1 << 2) && G::DrawingProps && !(Vars::Visuals::UI::CleanScreenshots.Value && I::EngineClient->IsTakingScreenshot()))
|
||||
return CALL_ORIGINAL(ecx, float(Vars::Colors::PropModulation.Value.a) / 255.f * flAlpha);
|
||||
if(Vars::Visuals::World::Modulations.Value & (1 << 2) &&
|
||||
G::DrawingProps &&
|
||||
!(Vars::Visuals::UI::CleanScreenshots.Value && I::EngineClient->IsTakingScreenshot()))
|
||||
{
|
||||
auto flVal = Vars::Colors::PropModulation.Value.a / 255.f * flAlpha;
|
||||
|
||||
if(flVal == 0.f)
|
||||
{
|
||||
flVal = 1.f;
|
||||
}
|
||||
|
||||
return CALL_ORIGINAL(ecx, flVal);
|
||||
}
|
||||
|
||||
|
||||
CALL_ORIGINAL(ecx, flAlpha);
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user