Skip to content

Commit

Permalink
Update Hooks.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
hydy100 authored Aug 25, 2024
1 parent 2e6d333 commit 5abd255
Showing 1 changed file with 0 additions and 33 deletions.
33 changes: 0 additions & 33 deletions R3nzSkin/Hooks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -241,44 +241,11 @@ namespace d3d_vtable {
cheatManager.logger->addLog("WndProc hooked!\n\tOriginal: 0x%X\n\tNew: 0x%X\n", &originalWndProc, &wndProc);
}

static void updateAllHeroSkin() {
const auto player{ cheatManager.memory->localPlayer };
const auto heroes{ cheatManager.memory->heroList };
static const auto my_team{ player ? player->get_team() : 100 };
auto& values{ cheatManager.database->champions_skins[fnv::hash_runtime(player->get_character_data_stack()->base_skin.model.str)] };
static const auto playerHash{ player ? fnv::hash_runtime(player->get_character_data_stack()->base_skin.model.str) : 0u };
if (const auto stack{ player->get_character_data_stack() }; stack->base_skin.skin != values[cheatManager.config->current_combo_skin_index - 1].skin_id && playerHash != FNV("Kaisa")) {
player->change_skin(values[cheatManager.config->current_combo_skin_index - 1].model_name, values[cheatManager.config->current_combo_skin_index - 1].skin_id);
}

for (auto i{ 0u }; i < heroes->length; ++i) {
const auto hero{ heroes->list[i] };
if (hero == player)
continue;

const auto champion_name_hash{ fnv::hash_runtime(hero->get_character_data_stack()->base_skin.model.str) };
if (champion_name_hash == FNV("PracticeTool_TargetDummy") && playerHash == FNV("Kaisa"))
continue;

const auto is_enemy{ my_team != hero->get_team() };
const auto& config_array{ is_enemy ? cheatManager.config->current_combo_enemy_skin_index : cheatManager.config->current_combo_ally_skin_index };
const auto config_entry{ config_array.find(champion_name_hash) };
if (config_entry == config_array.end())
continue;

if (config_entry->second > 0) {
const auto& values = cheatManager.database->champions_skins[champion_name_hash];
hero->change_skin(values[config_entry->second - 1].model_name, values[config_entry->second - 1].skin_id);
}
}
}

static void render() noexcept
{
const auto client{ cheatManager.memory->client };
if (client && client->game_state == GGameState_s::Running) {
cheatManager.hooks->init();
updateAllHeroSkin();
if (cheatManager.gui->is_open) {
::ImGui_ImplDX11_NewFrame();
::ImGui_ImplWin32_NewFrame();
Expand Down

0 comments on commit 5abd255

Please sign in to comment.