mirror of
https://github.com/VCMP-SqMod/SqMod.git
synced 2025-08-14 11:57:10 +02:00
Implement a constructor in the lightweight object type that copies a regular object.
This commit is contained in:
@@ -711,6 +711,18 @@ struct LightObject {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// Construct a LightObject from a regular Object instance.
|
||||||
|
///
|
||||||
|
/// \param so Object to copy
|
||||||
|
///
|
||||||
|
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
LightObject(const Object& obj) : mObj(obj.GetObject()) {
|
||||||
|
if (!sq_isnull(mObj)) {
|
||||||
|
sq_addref(obj.GetVM(), &mObj);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
/// Constructs an LightObject from a C++ instance
|
/// Constructs an LightObject from a C++ instance
|
||||||
///
|
///
|
||||||
|
Reference in New Issue
Block a user