Files
Project-Reboot-3.0/Project Reboot 3.0/SoftObjectPtr.h
Milxnor d53626a850 a lot
change how abilities work ("more" proper), readded vehicle spawning to s8-s12, fixed respawning on >s4, added a count check to looting so it can't drop 0 count, added zipline jumping, guarantee pawn spawn, clear inventory on aircraft
2023-03-31 18:06:36 -04:00

42 lines
792 B
C++

#pragma once
#include "Object.h"
#include "PersistentObjectPtr.h"
#include "SoftObjectPath.h"
#include "AssetPtr.h"
#include "reboot.h"
struct FSoftObjectPtr : public TPersistentObjectPtr<FSoftObjectPath>
{
public:
};
template<class T = UObject>
struct TSoftObjectPtr
{
public:
FSoftObjectPtr SoftObjectPtr;
T* Get(UClass* ClassToLoad = nullptr, bool bTryToLoad = false)
{
if (Engine_Version <= 416)
{
auto& AssetPtr = *(TAssetPtr<T>*)this;
return AssetPtr.Get();
}
else
{
if (SoftObjectPtr.ObjectID.AssetPathName.ComparisonIndex.Value <= 0)
return nullptr;
if (bTryToLoad)
{
return LoadObject<T>(SoftObjectPtr.ObjectID.AssetPathName.ToString(), ClassToLoad);
}
return FindObject<T>(SoftObjectPtr.ObjectID.AssetPathName.ToString());
}
}
};