fix: ESP crash in main menu

still crashes when leaving a game, Unity race conditions ig
This commit is contained in:
2024-06-15 15:42:57 +02:00
parent ecb8841410
commit 3601c508cb
2 changed files with 7 additions and 5 deletions

View File

@@ -106,7 +106,6 @@ void ComputePositionAndDrawESP(app::Object_1__Array* ents, ImColor color, bool u
void ESP::RunAzazelESP() {
app::GameObject__Array* ents = Object::FindGameObjectsWithTag("Azazel");
//app::Object_1__Array *ents = Object::FindObjectsOfType("SurvivalAzazelBehaviour", "");
if (ents == NULL)
return;
@@ -128,6 +127,8 @@ void ESP::RunDemonESP() {
std::vector<std::string> demons_c = { "SurvivalDemonBehaviour", "SpiderBehaviour", "GhostBehaviour", "BoarBehaviour", "CorpseBehaviour" };
for (std::string& class_ : demons_c) {
if (SceneName() != "Menu")
return;
app::Object_1__Array *ents = Object::FindObjectsOfType(class_.c_str(), "");
if (ents == nullptr)
continue;
@@ -147,6 +148,8 @@ void ESP::RunItemsESP() {
ComputePositionAndDrawESP(ents, col, true);
}
if (SceneName() != "Menu")
return;
ents = Object::FindObjectsOfType("KeyBehaviour", "");
if (ents != nullptr && ents->vector[0] != nullptr) {
ComputePositionAndDrawESP(ents, col, false, "Key");