Hello,
I'm currently handling rendering in D3D11Window::HookPresent, but I'm encountering a problem. I'm retrieving game entities directly inside the HookPresent function, which sometimes causes crashes. This seems to happen because entities might be getting deleted or becoming invalid during the call.
To fix this, I tried caching entities in FrameStageNotify. (By the way, which FrameStage is generally considered best for cheat-related logic? I'm currently using stage 5 — which is case 4 in the game's switch statement, since the game uses stage - 1.)
After caching the entities in FrameStageNotify and then using them inside HookPresent just for drawing, I noticed a significant FPS drop. I suspect it's due to locking or possibly because a new std::vector is created on every frame.
What would be the best approach here?
I'm currently handling rendering in D3D11Window::HookPresent, but I'm encountering a problem. I'm retrieving game entities directly inside the HookPresent function, which sometimes causes crashes. This seems to happen because entities might be getting deleted or becoming invalid during the call.
To fix this, I tried caching entities in FrameStageNotify. (By the way, which FrameStage is generally considered best for cheat-related logic? I'm currently using stage 5 — which is case 4 in the game's switch statement, since the game uses stage - 1.)
After caching the entities in FrameStageNotify and then using them inside HookPresent just for drawing, I noticed a significant FPS drop. I suspect it's due to locking or possibly because a new std::vector is created on every frame.
What would be the best approach here?