fix: ESP crash in main menu
still crashes when leaving a game, Unity race conditions ig
This commit is contained in:
@@ -106,7 +106,6 @@ void ComputePositionAndDrawESP(app::Object_1__Array* ents, ImColor color, bool u
|
|||||||
|
|
||||||
void ESP::RunAzazelESP() {
|
void ESP::RunAzazelESP() {
|
||||||
app::GameObject__Array* ents = Object::FindGameObjectsWithTag("Azazel");
|
app::GameObject__Array* ents = Object::FindGameObjectsWithTag("Azazel");
|
||||||
//app::Object_1__Array *ents = Object::FindObjectsOfType("SurvivalAzazelBehaviour", "");
|
|
||||||
|
|
||||||
if (ents == NULL)
|
if (ents == NULL)
|
||||||
return;
|
return;
|
||||||
@@ -128,6 +127,8 @@ void ESP::RunDemonESP() {
|
|||||||
std::vector<std::string> demons_c = { "SurvivalDemonBehaviour", "SpiderBehaviour", "GhostBehaviour", "BoarBehaviour", "CorpseBehaviour" };
|
std::vector<std::string> demons_c = { "SurvivalDemonBehaviour", "SpiderBehaviour", "GhostBehaviour", "BoarBehaviour", "CorpseBehaviour" };
|
||||||
|
|
||||||
for (std::string& class_ : demons_c) {
|
for (std::string& class_ : demons_c) {
|
||||||
|
if (SceneName() != "Menu")
|
||||||
|
return;
|
||||||
app::Object_1__Array *ents = Object::FindObjectsOfType(class_.c_str(), "");
|
app::Object_1__Array *ents = Object::FindObjectsOfType(class_.c_str(), "");
|
||||||
if (ents == nullptr)
|
if (ents == nullptr)
|
||||||
continue;
|
continue;
|
||||||
@@ -147,6 +148,8 @@ void ESP::RunItemsESP() {
|
|||||||
ComputePositionAndDrawESP(ents, col, true);
|
ComputePositionAndDrawESP(ents, col, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (SceneName() != "Menu")
|
||||||
|
return;
|
||||||
ents = Object::FindObjectsOfType("KeyBehaviour", "");
|
ents = Object::FindObjectsOfType("KeyBehaviour", "");
|
||||||
if (ents != nullptr && ents->vector[0] != nullptr) {
|
if (ents != nullptr && ents->vector[0] != nullptr) {
|
||||||
ComputePositionAndDrawESP(ents, col, false, "Key");
|
ComputePositionAndDrawESP(ents, col, false, "Key");
|
||||||
|
|||||||
@@ -759,20 +759,19 @@ HRESULT __stdcall hookD3D11Present(IDXGISwapChain* pSwapChain, UINT SyncInterval
|
|||||||
DrawMenu(open_menu);
|
DrawMenu(open_menu);
|
||||||
}
|
}
|
||||||
|
|
||||||
// to-do: move it to "fixed update" hook
|
|
||||||
if (settings::player_esp)
|
if (settings::player_esp)
|
||||||
ESP::RunPlayersESP();
|
ESP::RunPlayersESP();
|
||||||
|
|
||||||
if (settings::goat_esp)
|
if (settings::goat_esp && SceneName() != "Menu")
|
||||||
ESP::RunGoatsESP();
|
ESP::RunGoatsESP();
|
||||||
|
|
||||||
if (settings::item_esp)
|
if (settings::item_esp && SceneName() != "Menu")
|
||||||
ESP::RunItemsESP();
|
ESP::RunItemsESP();
|
||||||
|
|
||||||
if (settings::demon_esp)
|
if (settings::demon_esp)
|
||||||
ESP::RunDemonESP();
|
ESP::RunDemonESP();
|
||||||
|
|
||||||
if (settings::azazel_esp)
|
if (settings::azazel_esp && SceneName() != "Menu")
|
||||||
ESP::RunAzazelESP();
|
ESP::RunAzazelESP();
|
||||||
|
|
||||||
ImGui::GetIO().MouseDrawCursor = open_menu;
|
ImGui::GetIO().MouseDrawCursor = open_menu;
|
||||||
|
|||||||
Reference in New Issue
Block a user