Skip to content

Commit

Permalink
Fix CI
Browse files Browse the repository at this point in the history
  • Loading branch information
praydog committed Sep 24, 2023
1 parent cca43a7 commit 1012cc2
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions src/node/Undefined.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Undefined::Undefined(Config& cfg, Process& process, Property& props, size_t size
}
}

template <typename T> void handle_write(Process& process, uintptr_t address, std::byte* mem) {
template <typename T> void handle_undefined_write(Process& process, uintptr_t address, std::byte* mem) {
auto value = *(T*)mem;
ImGuiDataType datatype;

Expand Down Expand Up @@ -83,47 +83,47 @@ void Undefined::display(uintptr_t address, uintptr_t offset, std::byte* mem) {
auto is_hovered = ImGui::IsItemHovered();

if (ImGui::BeginPopupContextItem("UndefinedNodes")) {
if (ImGui::InputInt("Size Override", &size_override())) {
size_override() = std::clamp(size_override(), 0, 8);

if (size_override() == 0) {
m_size = m_original_size;
} else {
m_size = size_override();
}
}

switch(m_size) {
case 1:
ImGui::PushID("byte");
handle_write<uint8_t>(m_process, address, mem);
handle_undefined_write<uint8_t>(m_process, address, mem);
ImGui::PopID();
break;
case 2:
ImGui::PushID("short");
handle_write<uint16_t>(m_process, address, mem);
handle_undefined_write<uint16_t>(m_process, address, mem);
ImGui::PopID();
break;
case 4:
ImGui::PushID("int");
handle_write<int32_t>(m_process, address, mem);
handle_undefined_write<int32_t>(m_process, address, mem);
ImGui::PopID();

ImGui::PushID("float");
handle_write<float>(m_process, address, mem);
handle_undefined_write<float>(m_process, address, mem);
ImGui::PopID();
break;
case 8:
ImGui::PushID("long");
handle_write<int64_t>(m_process, address, mem);
handle_undefined_write<int64_t>(m_process, address, mem);
ImGui::PopID();

ImGui::PushID("double");
handle_write<double>(m_process, address, mem);
handle_undefined_write<double>(m_process, address, mem);
ImGui::PopID();
break;
}

if (ImGui::InputInt("Size Override", &size_override())) {
size_override() = std::clamp(size_override(), 0, 8);

if (size_override() == 0) {
m_size = m_original_size;
} else {
m_size = size_override();
}
}

ImGui::EndPopup();
}

Expand Down

0 comments on commit 1012cc2

Please sign in to comment.