ALittlePatate / DevourClient

A cheat for the game Devour.
GNU General Public License v3.0
66 stars 17 forks source link

Temp fix for random crashes during the game while using ESP #64

Closed JozielBorges closed 2 months ago

JozielBorges commented 2 months ago

This pull request addresses issue #60 by implementing a temporary fix to prevent random crashes related to the ESP feature during gameplay. The main changes include updates to esp.cpp and modifications in the hNolanBehaviour_Update hook.

Changes Made:

hNolanBehaviour_Update Hook:

  1. Added a check to ensure the ESP functionality does not execute in the menu, if in game, update the goat list, in this way we prevent the error by invalid memory addresses.

ESP.cpp Modifications:

  1. Introduced a RefreshEntList function to manage entity lists and avoid accessing invalid memory. This function serves as an example and might be useful for future improvements.
  2. Updated the RunAzazelESP function to refresh the Azazel entity list periodically, preventing crashes by ensuring the pointers are up-to-date.
  3. Improved the RunItemsESP function to maintain a list of items and update it periodically, similar to the Azazel entity handling.

ESP.h Update:

  1. Introduced the follow variables to the namespace:

    • inline app::GameObject__Array* ents_azazel = NULL; // OLD AZAZEL
    • inline app::Object_1__Array* ents_item; // OLD ITEM LIST
    • inline app::Object_1__Array* ents_goat; // REAL TIME GOAT FROM HOOK
    • inline int time_refresh = 100;
    • inline int time_counter = 0;

Summary:

These changes aim to stabilize the ESP feature by managing entity lists more effectively and avoiding invalid memory accesses. The temporary fixes implemented will mitigate random crashes, especially during non-menu gameplay scenarios.

Please review these changes and let me know if there are any adjustments needed. Thank you!

ALittlePatate commented 2 months ago

Everything seems to be good, thanks a lot for the contribution !