F4MP/tiltedcode/Code/client/Games/Skyrim/NetImmerse/NiPointer.h
Jous99 37b16f1547 code upload
codigo original de f4mp y tilted para referencias
2026-01-06 18:45:00 +01:00

36 lines
639 B
C++

#pragma once
template <class T> struct NiPointer
{
NiPointer<T>& operator=(const NiPointer& acRhs)
{
if (object != acRhs.object)
{
if (acRhs.object)
acRhs.object->IncRef();
if (object)
object->DecRef();
object = acRhs.object;
}
return *this;
}
NiPointer<T>& operator=(T* aRhs)
{
if (object != aRhs)
{
if (aRhs)
aRhs->IncRef();
if (object)
object->DecRef();
object = aRhs;
}
return *this;
}
T* object;
};