Closed piz-ewing closed 9 months ago
Temporary solution
sdk-basic.cpp
#include "SDKDirect.h"
#include <chrono>
#include <thread>
SDK::UWorld *SDK::World = nullptr;
SDK::APalGameStateInGame *SDK::StateInGame = nullptr;
bool SDK::sdk_init() {
for (size_t times=0; times<10; times++) {
if (World == nullptr) {
World = *reinterpret_cast<SDK::UWorld **>(uintptr_t(GetImageBaseOffset()) + Offsets::GWorld);
}
if (World != nullptr) {
StateInGame = GetPalGameStateInGame(World);
if (StateInGame != nullptr) {
return true;
}
}
std::this_thread::sleep_for(std::chrono::seconds(1));
}
return false;
}
Injecting too early, requires a flag to determine whether the object has been created