move PlayerCharacter to globals

This commit is contained in:
ApfelTeeSaft
2024-10-28 09:52:21 +01:00
parent a73a9b5153
commit 83d51754d6
3 changed files with 11 additions and 1 deletions
-1
View File
@@ -6,7 +6,6 @@ void (*oProcessEvent)(SDK::UObject* Object, SDK::UFunction* Function, void* Para
void hkProcessEvent(SDK::UObject* Object, SDK::UFunction* Function, void* Parameters)
{
string FunctionName = Function->GetName();
auto* PlayerCharacter = nullptr // for now, implement later dunno where it is
// mockup for now
if (FunctionName == "OnUnrealConsoleInput");
+10
View File
@@ -5,6 +5,7 @@
SDK::UEngine* Engine = nullptr;
SDK::UWorld* World = nullptr;
SDK::APlayerController* AF4PlayerController = nullptr;
SDK::ACharacter* PlayerCharacter = nullptr;
SDK::ULevel* Level = nullptr;
SDK::TArray<SDK::AActor*>* Actors = nullptr;
@@ -34,6 +35,15 @@ void InitializeGlobals()
return;
}
if (AF4PlayerController)
{
PlayerCharacter = AF4PlayerController->FOV(); // TODO: Add PlayerCharacter, i am too retarded to find it
if (!PlayerCharacter)
{
std::cerr << "Failed to retrieve PlayerCharacter." << std::endl;
}
}
Level = World->PersistentLevel;
if (!Level)
{
+1
View File
@@ -4,6 +4,7 @@
extern SDK::UEngine* Engine;
extern SDK::UWorld* World;
extern SDK::APlayerController* AF4PlayerController;
extern SDK::ACharacter* PlayerCharacter;
extern SDK::ULevel* Level;
extern SDK::TArray<SDK::AActor*>* Actors;