Skip to content
This repository has been archived by the owner on Oct 7, 2024. It is now read-only.

Commit

Permalink
c++ is stupid
Browse files Browse the repository at this point in the history
so yeah, the toggle patch function wasn't getting called for some reason
  • Loading branch information
Prevter committed May 17, 2024
1 parent abf587f commit 9a390df
Showing 1 changed file with 2 additions and 15 deletions.
17 changes: 2 additions & 15 deletions src/shared/hacks/respawn-delay/respawn-delay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,9 @@ namespace openhack::hacks {
static ToggleComponent* s_respawnDelay = nullptr;

void toggleDelayPatch() {
L_TRACE("Toggling Respawn Delay patch");
if (!s_respawnDelay) {
L_WARN("Respawn Delay not initialized");
return;
}
if (!s_respawnDelay) return;
bool enabled = config::get<bool>("hack.respawn_delay.enabled");
bool success = s_respawnDelay->applyPatch(enabled);
if (success) {
L_INFO("Respawn Delay patch {}!", enabled ? "enabled" : "disabled");
} else {
L_WARN("Failed to patch Respawn Delay");
}
s_respawnDelay->applyPatch(enabled);
}

void RespawnDelay::onInit() {
Expand Down Expand Up @@ -62,13 +53,9 @@ namespace openhack::hacks {
}

// Merge opcodes and customBypass
L_TRACE("Merging opcodes and customBypass ({} + {})", opcodes.size(), customBypass.size());
opcodes.insert(opcodes.end(), customBypass.begin(), customBypass.end());
L_TRACE("Merged opcodes size: {}", opcodes.size());
s_respawnDelay = new ToggleComponent("", "", opcodes);
L_TRACE("Respawn Delay initialized");
toggleDelayPatch();
L_TRACE("Respawn Delay patched");

// Initialize keybind
menu::keybinds::setKeybindCallback("respawn_delay.enabled", []() {
Expand Down

0 comments on commit 9a390df

Please sign in to comment.