Skip to content

Commit

Permalink
Added particle effect changers, Added WIP Streamer mode
Browse files Browse the repository at this point in the history
  • Loading branch information
Viceroyy committed Aug 8, 2024
1 parent ebc5d38 commit 577eaa3
Show file tree
Hide file tree
Showing 18 changed files with 362 additions and 3 deletions.
6 changes: 6 additions & 0 deletions Fusion/Fusion.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,7 @@
<ClCompile Include="src\Hooks\BaseClientDLL_FrameStageNotify.cpp" />
<ClCompile Include="src\Hooks\BaseClientDLL_Shutdown.cpp" />
<ClCompile Include="src\Hooks\CAchievementMgr_CheckAchievementsEnabled.cpp" />
<ClCompile Include="src\Hooks\CAttributeManager_AttribHookValue.cpp" />
<ClCompile Include="src\Hooks\CBaseAnimating_FrameAdvance.cpp" />
<ClCompile Include="src\Hooks\CBaseAnimating_Interpolate.cpp" />
<ClCompile Include="src\Hooks\CBaseAnimating_MaintainSequenceTransitions.cpp" />
Expand All @@ -284,6 +285,8 @@
<ClCompile Include="src\Hooks\CBaseEntity_SetAbsVelocity.cpp" />
<ClCompile Include="src\Hooks\CBaseHudChat_ChatPrintf.cpp" />
<ClCompile Include="src\Hooks\CBasePlayer_CalcViewModelView.cpp" />
<ClCompile Include="src\Hooks\CClientScoreBoardDialog_UpdatePlayerAvatar.cpp" />
<ClCompile Include="src\Hooks\CCvar_ConsoleColorPrintf.cpp" />
<ClCompile Include="src\Hooks\CEconItemSchema_GetItemDefinition.cpp" />
<ClCompile Include="src\Hooks\CGameEventManager_FireEventIntern.cpp" />
<ClCompile Include="src\Hooks\CHudCrosshair_GetDrawPosition.cpp" />
Expand All @@ -303,6 +306,7 @@
<ClCompile Include="src\Hooks\CMaterial_Uncache.cpp" />
<ClCompile Include="src\Hooks\CNetChan_SendNetMsg.cpp" />
<ClCompile Include="src\Hooks\COPRenderSprites_RenderSpriteCard.cpp" />
<ClCompile Include="src\Hooks\CParticleProperty_Create.cpp" />
<ClCompile Include="src\Hooks\CPlayerResource_GetTeamColor.cpp" />
<ClCompile Include="src\Hooks\CPrediction_RunCommand.cpp" />
<ClCompile Include="src\Hooks\CRendering3dView_EnableWorldFog.cpp" />
Expand All @@ -324,6 +328,7 @@
<ClCompile Include="src\Hooks\CTFWeaponBase_GetShootSound.cpp" />
<ClCompile Include="src\Hooks\CTFWearable_ShouldDraw.cpp" />
<ClCompile Include="src\Hooks\CViewRender_DrawUnderwaterOverlay.cpp" />
<ClCompile Include="src\Hooks\C_PlayerResource_GetPlayerName.cpp" />
<ClCompile Include="src\Hooks\Direct3DDevice9_EndScene.cpp" />
<ClCompile Include="src\Hooks\DoEnginePostProcessing.cpp" />
<ClCompile Include="src\Hooks\DSP_Process.cpp" />
Expand All @@ -341,6 +346,7 @@
<ClCompile Include="src\Hooks\StudioRender_SetColorModulation.cpp" />
<ClCompile Include="src\Hooks\S_StartDynamicSound.cpp" />
<ClCompile Include="src\Hooks\S_StartSound.cpp" />
<ClCompile Include="src\Hooks\TF_IsHolidayActive.cpp" />
<ClCompile Include="src\Hooks\VGuiMenuBuilder_AddMenuItem.cpp" />
<ClCompile Include="src\Hooks\ViewRender_LevelInit.cpp" />
<ClCompile Include="src\Hooks\ViewRender_LevelShutdown.cpp" />
Expand Down
6 changes: 6 additions & 0 deletions Fusion/Fusion.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,12 @@
<ClCompile Include="src\Utils\EventListener\EventListener.cpp" />
<ClCompile Include="src\Hooks\CTFWearable_ShouldDraw.cpp" />
<ClCompile Include="src\Hooks\S_StartSound.cpp" />
<ClCompile Include="src\Hooks\CParticleProperty_Create.cpp" />
<ClCompile Include="src\Hooks\CAttributeManager_AttribHookValue.cpp" />
<ClCompile Include="src\Hooks\TF_IsHolidayActive.cpp" />
<ClCompile Include="src\Hooks\CClientScoreBoardDialog_UpdatePlayerAvatar.cpp" />
<ClCompile Include="src\Hooks\C_PlayerResource_GetPlayerName.cpp" />
<ClCompile Include="src\Hooks\CCvar_ConsoleColorPrintf.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="src\Utils\UtlVector\UtlVector.h" />
Expand Down
2 changes: 2 additions & 0 deletions Fusion/src/Features/Aimbot/AimbotHitscan/AimbotHitscan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -704,10 +704,12 @@ void CAimbotHitscan::Run(CTFPlayer* pLocal, CTFWeaponBase* pWeapon, CUserCmd* pC
switch (nWeaponID)
{
case TF_WEAPON_MINIGUN:
{
pCmd->buttons |= IN_ATTACK2;
if (pWeapon->As<CTFMinigun>()->m_iWeaponState() != AC_STATE_FIRING && pWeapon->As<CTFMinigun>()->m_iWeaponState() != AC_STATE_SPINNING)
return;
break;
}
case TF_WEAPON_SNIPERRIFLE:
case TF_WEAPON_SNIPERRIFLE_DECAP:
{
Expand Down
10 changes: 9 additions & 1 deletion Fusion/src/Features/ImGui/Menu/Menu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -625,6 +625,7 @@ void CMenu::MenuVisuals()
FToggle("Clean screenshots", Vars::Visuals::UI::CleanScreenshots, FToggle_Middle);
FToggle("Sniper sightlines", Vars::Visuals::UI::SniperSightlines);
FToggle("Pickup timers", Vars::Visuals::UI::PickupTimers, FToggle_Middle);
FToggle("Streamer mode (WIP)", Vars::Visuals::UI::StreamerMode);
} EndSection();
if (Section("Viewmodel"))
{
Expand Down Expand Up @@ -667,6 +668,13 @@ void CMenu::MenuVisuals()
FToggle("MEDIC: Show injured teammates", Vars::Visuals::Other::ShowInjuredTeammatesWhenMedic);
FToggle("Low graphics", Vars::Visuals::Other::ThePS2Inator);
} EndSection();
if (Section("Particles"))
{
FDropdown("Medigun beam", Vars::Visuals::Particle::MedigunBeamEffect, { "Off", "Dispenser heal", "PASS Time", "Bombonomicon spell", "White", "Uber" }, {}, FDropdown_Left);
FDropdown("Medigun charge", Vars::Visuals::Particle::MedigunChargeEffect, { "Off", "Fireball spell", "Spellbound", "Electrocuted", "Cloud 9", "Electrostatic", "Knifestorm", "Frostbite", "Haunted Phantasm Jr.", "Time Warp", "Stormy 13th Hour", "Terror-Watt", "Sunbeams", "Sunbeams new", "Disco beams", "Pumpkin" }, {}, FDropdown_Right);
FDropdown("Rocket trail", Vars::Visuals::Particle::RocketTrailEffect, { "Off", "Crit", "Bubbles", "Halloween", "Airstrike", "Monoculus", "Cow Mangler", "Cow Mangler charged" }, {}, FDropdown_Left);
FToggle("Rainbow footsteps", Vars::Visuals::Particle::RainbowFootstepEffect);
} EndSection();
if (Section("Bullet"))
{
FColorPicker("Bullet tracer color", Vars::Colors::BulletTracer);
Expand Down Expand Up @@ -738,7 +746,7 @@ void CMenu::MenuVisuals()
} EndSection();
if (Section("World"))
{
FSDropdown("World texture", Vars::Visuals::World::WorldTexture, { "Default", "Dev", "Camo", "Black", "White", "Flat" }, FSDropdown_Custom);
FSDropdown("World texture", Vars::Visuals::World::WorldTexture, { "Default", "Dev", "Camo", "Black", "White" }, FSDropdown_Custom);
FDropdown("Modulations", Vars::Visuals::World::Modulations, { "World", "Sky", "Prop", "Particle", "Fog" }, {}, FDropdown_Left | FDropdown_Multi);
static std::vector skyNames = {
"Off", "sky_tf2_04", "sky_upward", "sky_dustbowl_01", "sky_goldrush_01", "sky_granary_01", "sky_well_01", "sky_gravel_01", "sky_badlands_01",
Expand Down
17 changes: 16 additions & 1 deletion Fusion/src/Features/Visuals/ESP/ESP.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,22 @@ void CESP::DrawPlayers(CTFPlayer* pLocal)
if (Vars::ESP::Player.Value & 1 << 0)
{
tOffset += fFontName.m_nTall + 2;
H::Draw.String(fFontName, middle, y - tOffset, Vars::Menu::Theme::Active.Value, ALIGN_TOP, SDK::ConvertUtf8ToWide(pi.name).data());
if (Vars::Visuals::UI::StreamerMode.Value)
{
const char* name;
if (nIndex == I::EngineClient->GetLocalPlayer())
name = "You";
else if (H::Entities.IsFriend(nIndex))
name = "Friend";
else if (pPlayer->m_iTeamNum() != pLocal->m_iTeamNum())
name = "Enemy";
else if (pPlayer->m_iTeamNum() == pLocal->m_iTeamNum())
name = "Teammate";

H::Draw.String(fFontName, middle, y - tOffset, Vars::Menu::Theme::Active.Value, ALIGN_TOP, name);
}
else
H::Draw.String(fFontName, middle, y - tOffset, Vars::Menu::Theme::Active.Value, ALIGN_TOP, SDK::ConvertUtf8ToWide(pi.name).data());
}

if (Vars::ESP::Player.Value & 1 << 12)
Expand Down
13 changes: 12 additions & 1 deletion Fusion/src/Features/Visuals/SpectatorList/SpectatorList.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,19 @@ bool CSpectatorList::GetSpectators(CTFPlayer* pLocal)
PlayerInfo_t pi{};
if (I::EngineClient->GetPlayerInfo(pPlayer->entindex(), &pi))
{
std::wstring name = SDK::ConvertUtf8ToWide(pi.name);
if (Vars::Visuals::UI::StreamerMode.Value)
{
if (H::Entities.IsFriend(pPlayer->entindex()))
name = L"Friend";
else if (pPlayer->m_iTeamNum() != pLocal->m_iTeamNum())
name = L"Enemy";
else if (pPlayer->m_iTeamNum() == pLocal->m_iTeamNum())
name = L"Teammate";
}

Spectators.push_back({
SDK::ConvertUtf8ToWide(pi.name), szMode, respawnIn, respawnTimeIncreased, H::Entities.IsFriend(pPlayer->entindex()),
name, szMode, respawnIn, respawnTimeIncreased, H::Entities.IsFriend(pPlayer->entindex()),
pPlayer->m_iTeamNum(), pPlayer->entindex()
});
}
Expand Down
29 changes: 29 additions & 0 deletions Fusion/src/Hooks/CAttributeManager_AttribHookValue.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#include "../SDK/SDK.h"

// Credits to Mad?

MAKE_SIGNATURE(CAttributeManager_AttribHookValue, "client.dll", "4C 8B DC 49 89 5B ? 49 89 6B ? 49 89 73 ? 57 41 54 41 55 41 56 41 57 48 83 EC ? 48 8B 3D ? ? ? ? 4C 8D 35", 0x0);
MAKE_SIGNATURE(FireEvent_AttribHookValue_Call, "client.dll", "E8 ? ? ? ? 8B F8 83 BE", 0x5);

MAKE_HOOK(CAttributeManager_AttribHookValue, S::CAttributeManager_AttribHookValue(), int, __fastcall,
int baseVal, const char* str, void* pEnt, void* buffer, bool isGlobalConstStr)
{
if (!Vars::Visuals::Particle::RainbowFootstepEffect.Value || I::EngineClient->IsTakingScreenshot() && Vars::Visuals::UI::CleanScreenshots.Value)
return CALL_ORIGINAL(baseVal, str, pEnt, buffer, isGlobalConstStr);

static const auto dwDesired = S::FireEvent_AttribHookValue_Call();
const auto dwRetAddr = std::uintptr_t(_ReturnAddress());

if (dwRetAddr == dwDesired)
{
static constexpr int HashedFootstepType = FNV1A::HashConst("halloween_footstep_type");
auto Hashed = FNV1A::Hash(str);
if (Hashed == HashedFootstepType)
{
Color_t Color = SDK::Rainbow();
return std::stoul(std::format("0x{:02X}{:02X}{:02X}", Color.r, Color.g, Color.b), nullptr, 16);
}
}

return CALL_ORIGINAL(baseVal, str, pEnt, buffer, isGlobalConstStr);
}
23 changes: 23 additions & 0 deletions Fusion/src/Hooks/CBaseHudChat_ChatPrintf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

#include "../Features/Players/PlayerUtils.h"

std::string ColorRed = { '\x7', 'F', 'F', '3', 'F', '3', 'F' };
std::string ColorBlue = { '\x7', '9', '9', 'C', 'C', 'F', 'F' };

MAKE_HOOK(CBaseHudChat_ChatPrintf, U::Memory.GetVFunc(I::ClientModeShared->m_pChatElement, 19), void, __fastcall,
void* ecx, int iPlayerIndex, int iFilter, const char* fmt, ...)
{
Expand Down Expand Up @@ -51,5 +54,25 @@ MAKE_HOOK(CBaseHudChat_ChatPrintf, U::Memory.GetVFunc(I::ClientModeShared->m_pCh
}
}

CTFPlayer* pEntity = I::ClientEntityList->GetClientEntity(iPlayerIndex)->As<CTFPlayer>();
auto pLocal = H::Entities.GetLocal();
if (Vars::Visuals::UI::StreamerMode.Value && pEntity && pLocal)
{
std::string changedname;
if (iPlayerIndex == I::EngineClient->GetLocalPlayer())
changedname = "You";
else if (H::Entities.IsFriend(iPlayerIndex))
changedname = "Friend";
else if (pEntity->m_iTeamNum() != pLocal->m_iTeamNum())
changedname = "Enemy";
else if (pEntity->m_iTeamNum() == pLocal->m_iTeamNum())
changedname = "Teammate";

std::string newname = pEntity->IsAlive() ? (changedname + "\x1") : changedname;
std::string finalname = (pEntity->m_iTeamNum() == TF_TEAM_RED ? ColorRed : ColorBlue) + newname;
std::string finalmessage = (pEntity->IsAlive() ? "" : "\x1*DEAD* ") + finalname;
finalMsg = finalMsg.replace(0, finalMsg.find(name) + name.length(), finalmessage.c_str());
}

CALL_ORIGINAL(ecx, iPlayerIndex, iFilter, "%s", finalMsg.c_str());
}
12 changes: 12 additions & 0 deletions Fusion/src/Hooks/CClientScoreBoardDialog_UpdatePlayerAvatar.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#include "../SDK/SDK.h"

MAKE_SIGNATURE(CClientScoreBoardDialog_UpdatePlayerAvatar, "client.dll", "4D 85 C0 0F 84 ? ? ? ? 53 55", 0x0);

MAKE_HOOK(CClientScoreBoardDialog_UpdatePlayerAvatar, S::CClientScoreBoardDialog_UpdatePlayerAvatar(), void, __fastcall,
void* ecx, int playerIndex, KeyValues* kv)
{
if (Vars::Visuals::UI::StreamerMode.Value)
return; // :trollface:

CALL_ORIGINAL(ecx, playerIndex, kv);
}
18 changes: 18 additions & 0 deletions Fusion/src/Hooks/CCvar_ConsoleColorPrintf.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#include "../SDK/SDK.h"

MAKE_HOOK(CCvar_ConsoleColorPrintf, U::Memory.GetVFunc(I::CVar, 23), void, __fastcall,
void* ecx, const Color_t& clr, const char* pFormat, ...)
{
va_list marker;
char buffer[4096];
va_start(marker, pFormat);
vsnprintf_s(buffer, sizeof(buffer), pFormat, marker);
va_end(marker);

char* msg = buffer;
if (!*msg) { return; }

std::string Message = msg;

return CALL_ORIGINAL(ecx, clr, "%s", Message.c_str());
}
122 changes: 122 additions & 0 deletions Fusion/src/Hooks/CParticleProperty_Create.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
#include "../SDK/SDK.h"

// Credits to Mad? for the idea and medigun particle changer
// Credits to yaya for the x86 sigs, rocket trail particle changer and the whole code :trollface:

MAKE_SIGNATURE(CParticleProperty_Create, "client.dll", "48 89 5C 24 ? 48 89 6C 24 ? 48 89 74 24 ? 48 89 7C 24 ? 41 56 48 83 EC ? 48 8B 59 ? 49 8B F1", 0x0);

MAKE_SIGNATURE(UpdateEffectsCall1, "client.dll", "E8 ? ? ? ? 49 8B CC F3 0F 11 74 24", 0x5);
MAKE_SIGNATURE(UpdateEffectsCall2, "client.dll", "E8 ? ? ? ? 41 8B 14 24 48 8B D8", 0x5);
MAKE_SIGNATURE(ManageChargeEffectCall, "client.dll", "E8 ? ? ? ? 48 89 86 ? ? ? ? 48 89 BE", 0x5);
MAKE_SIGNATURE(Rockettrail_UnderwaterCall, "client.dll", "E8 ? ? ? ? 48 8B 5C 24 ? 40 38 B7", 0x5);

MAKE_HOOK(CParticleProperty_Create, S::CParticleProperty_Create(), int, __fastcall,
void* ecx, const char* pszParticleName, ParticleAttachment_t iAttachType, const char* pszAttachmentName)
{
if (I::EngineClient->IsTakingScreenshot() && Vars::Visuals::UI::CleanScreenshots.Value)
return CALL_ORIGINAL(ecx, pszParticleName, iAttachType, pszAttachmentName);

if (auto pLocal = H::Entities.GetLocal())
{
static auto UpdateEffectsCall1 = S::UpdateEffectsCall1();
static auto UpdateEffectsCall2 = S::UpdateEffectsCall2();
static auto ManageChargeEffectCall = S::ManageChargeEffectCall();
static auto Rockettrail_UnderwaterCall = S::Rockettrail_UnderwaterCall();

const auto dwRetAddr = std::uintptr_t(_ReturnAddress());

if (dwRetAddr == UpdateEffectsCall1 || dwRetAddr == UpdateEffectsCall2)
{
switch (Vars::Visuals::Particle::MedigunBeamEffect.Value)
{
case 0: break;
case 1: pszParticleName = pLocal->m_iTeamNum() == TF_TEAM_BLUE ? "dispenser_heal_blue" : "dispenser_heal_red"; break;
case 2: pszParticleName = "passtime_beam"; break;
case 3: pszParticleName = "bombonomicon_spell_trail"; break;
case 4: pszParticleName = "medicgun_beam_machinery_stage3"; break;
case 5: pszParticleName = pLocal->m_iTeamNum() == TF_TEAM_BLUE ? "medicgun_beam_blue_invun" : "medicgun_beam_red_invun"; break;
}
}

if (dwRetAddr == ManageChargeEffectCall)
{
switch (Vars::Visuals::Particle::MedigunChargeEffect.Value)
{
case 0: break;
case 1: pszParticleName = pLocal->m_iTeamNum() == TF_TEAM_BLUE ? "spell_fireball_small_trail_blue" : "spell_fireball_small_trail_red"; break;
case 2: pszParticleName = "unusual_spellbook_circle_purple"; break;
case 3: pszParticleName = pLocal->m_iTeamNum() == TF_TEAM_BLUE ? "electrocuted_blue" : "electrocuted_red"; break;
case 4: pszParticleName = "unusual_hearts_bubbling"; break;
case 5: pszParticleName = pLocal->m_iTeamNum() == TF_TEAM_BLUE ? "unusual_robot_orbiting_sparks" : "unusual_robot_orbiting_sparks2"; break;
case 6: pszParticleName = "unusual_storm_knives_clouds"; break;
case 7: pszParticleName = "unusual_eotl_frostbite"; break;
case 8: pszParticleName = pLocal->m_iTeamNum() == TF_TEAM_BLUE ? "unusual_souls_green_parent" : "unusual_souls_purple_parent"; break;
case 9: pszParticleName = pLocal->m_iTeamNum() == TF_TEAM_BLUE ? "unusual_robot_time_warp" : "unusual_robot_time_warp2"; break;
case 10: pszParticleName = "unusual_storm_spooky"; break;
case 11: pszParticleName = pLocal->m_iTeamNum() == TF_TEAM_BLUE ? "unusual_zap_green" : "unusual_zap_yellow"; break;
case 12: pszParticleName = "superrare_beams1"; break;
case 13: pszParticleName = "superrare_beams1_newstyle"; break;
case 14: pszParticleName = "utaunt_disco_beams3"; break;
case 15: pszParticleName = "ghost_pumpkin"; break;
}
}

if (dwRetAddr == Rockettrail_UnderwaterCall)
{
switch (Vars::Visuals::Particle::RocketTrailEffect.Value)
{
case 0: break;
case 1: pszParticleName = pLocal->m_iTeamNum() == TF_TEAM_BLUE ? "critical_rocket_blue" : "critical_rocket_red"; break;
case 2: pszParticleName = "rockettrail_underwater"; break;
case 3: pszParticleName = "halloween_rockettrail"; break;
case 4: pszParticleName = "rockettrail_airstrike_line"; break;
case 5: pszParticleName = "eyeboss_projectile"; break;
case 6: pszParticleName = pLocal->m_iTeamNum() == TF_TEAM_BLUE ? "drg_cow_rockettrail_normal_blue" : "drg_cow_rockettrail_normal"; break;
case 7: pszParticleName = pLocal->m_iTeamNum() == TF_TEAM_BLUE ? "drg_cow_rockettrail_charged_blue" : "drg_cow_rockettrail_charged"; break;
}
}
}

return CALL_ORIGINAL(ecx, pszParticleName, iAttachType, pszAttachmentName);
}

MAKE_SIGNATURE(CParticleProperty_Create2, "client.dll", "44 89 4C 24 ? 44 89 44 24 ? 53", 0x0);

MAKE_SIGNATURE(Rockettrail_AirstrikeCall, "client.dll", "E8 ? ? ? ? 48 8B CF E8 ? ? ? ? 48 8B D8 48 85 C0 0F 84", 0x5);
MAKE_SIGNATURE(Rockettrail_bUsingCustomCall, "client.dll", "E8 ? ? ? ? EB ? 4C 8D 0D ? ? ? ? 41 B8 ? ? ? ? 48 8D 15", 0x5);
MAKE_SIGNATURE(Halloween_RockettrailCall, "client.dll", "E8 ? ? ? ? E9 ? ? ? ? 48 85 DB 0F 85", 0x5);
MAKE_SIGNATURE(CTFProjectile_EnergyBallCall, "client.dll", "E8 ? ? ? ? 48 8B 7C 24 ? 48 89 83", 0x5);

MAKE_HOOK(CParticleProperty_Create2, S::CParticleProperty_Create2(), int, __fastcall,
void* ecx, const char* pszParticleName, ParticleAttachment_t iAttachType, int iAttachmentPoint, Vector vecOriginOffset)
{
if (I::EngineClient->IsTakingScreenshot() && Vars::Visuals::UI::CleanScreenshots.Value)
return CALL_ORIGINAL(ecx, pszParticleName, iAttachType, iAttachmentPoint, vecOriginOffset);

if (auto pLocal = H::Entities.GetLocal())
{
static auto Rockettrail_AirstrikeCall = S::Rockettrail_AirstrikeCall();
static auto Rockettrail_bUsingCustomCall = S::Rockettrail_bUsingCustomCall();
static auto Halloween_RockettrailCall = S::Halloween_RockettrailCall();
static auto CTFProjectile_EnergyBallCall = S::CTFProjectile_EnergyBallCall();

const auto dwRetAddr = std::uintptr_t(_ReturnAddress());

if (dwRetAddr == Rockettrail_AirstrikeCall || dwRetAddr == Rockettrail_bUsingCustomCall || dwRetAddr == Halloween_RockettrailCall || dwRetAddr == CTFProjectile_EnergyBallCall)
{
switch (Vars::Visuals::Particle::RocketTrailEffect.Value)
{
case 0: break;
case 1: pszParticleName = pLocal->m_iTeamNum() == TF_TEAM_BLUE ? "critical_rocket_blue" : "critical_rocket_red"; break;
case 2: pszParticleName = "rockettrail_underwater"; break;
case 3: pszParticleName = "halloween_rockettrail"; break;
case 4: pszParticleName = "rockettrail_airstrike_line"; break;
case 5: pszParticleName = "eyeboss_projectile"; break;
case 6: pszParticleName = pLocal->m_iTeamNum() == TF_TEAM_BLUE ? "drg_cow_rockettrail_normal_blue" : "drg_cow_rockettrail_normal"; break;
case 7: pszParticleName = pLocal->m_iTeamNum() == TF_TEAM_BLUE ? "drg_cow_rockettrail_charged_blue" : "drg_cow_rockettrail_charged"; break;
}
}
}

return CALL_ORIGINAL(ecx, pszParticleName, iAttachType, iAttachmentPoint, vecOriginOffset);
}
Loading

0 comments on commit 577eaa3

Please sign in to comment.