add prints

This commit is contained in:
altalk23 2022-04-07 11:44:07 +03:00
parent 393479d2ba
commit 76dc6a55ec

View file

@ -1,5 +1,6 @@
#pragma once
#include <iostream>
#include "../meta/meta.hpp"
namespace geode::core {
@ -9,11 +10,15 @@ namespace geode::core {
template <auto& Det, class Ret, class ...Args>
Ret handler(Args... args) {
static thread_local int counter = 0;
std::cout << "detour size: " << Det->size() << std::endl;
if constexpr (std::is_same_v<Ret, void>) {
if (counter == Det->size()) counter = 0;
std::cout << "detour index: " << counter << std::endl;
if (counter < Det->size()) {
std::cout << "calling " << (void*)Det->at(counter++) << std::endl;
Det->at(counter++)(args...);
}