2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-12-09 09:47:43 +00:00

CToken fix

Initial CRSC
This commit is contained in:
2016-02-15 23:01:55 -08:00
parent 6614171283
commit 18e34b4dce
7 changed files with 189 additions and 4 deletions

View File

@@ -233,7 +233,12 @@ public:
TToken(T* obj)
: CToken(GetIObjObjectFor(std::unique_ptr<T>(obj))) {}
TToken& operator=(T* obj) {*this = CToken(GetIObjObjectFor(obj)); return this;}
T* GetObj() {return static_cast<TObjOwnerDerivedFromIObj<T>*>(CToken::GetObj())->GetObj();}
T* GetObj()
{
if (CToken::GetObj())
return static_cast<TObjOwnerDerivedFromIObj<T>*>(CToken::GetObj())->GetObj();
return nullptr;
}
T* operator->() {return GetObj();}
};