1
0
mirror of https://github.com/VCMP-SqMod/SqMod.git synced 2024-11-08 00:37:15 +01:00

Added constructor to create a player entity reference from a base reference.

This commit is contained in:
Sandu Liviu Catalin 2015-11-01 01:32:41 +02:00
parent 8d8c9be2fd
commit b0c174e75e
2 changed files with 15 additions and 1 deletions

View File

@ -18,6 +18,13 @@ Vector3 CPlayer::s_Vector3;
// ------------------------------------------------------------------------------------------------
SQChar CPlayer::s_Buffer[128];
// ------------------------------------------------------------------------------------------------
CPlayer::CPlayer(const Reference< CPlayer > & o) noexcept
: Reference(o)
{
/* ... */
}
// ------------------------------------------------------------------------------------------------
bool CPlayer::IsStreamedFor(const Reference < CPlayer > & player) const noexcept
{
@ -1700,10 +1707,12 @@ bool Register_CPlayer(HSQUIRRELVM vm)
// Registration failed
return false;
}
// Typedef the base reference type for simplicity
typedef Reference< CPlayer > RefType;
// Output debugging information
LogDbg("Beginning registration of <CPlayer> type");
// Attempt to register the actual reference that implements all of the entity functionality
Sqrat::RootTable(vm).Bind(_SC("CPlayer"), Sqrat::DerivedClass< CPlayer, Reference< CPlayer > >(vm, _SC("CPlayer"))
Sqrat::RootTable(vm).Bind(_SC("CPlayer"), Sqrat::DerivedClass< CPlayer, RefType >(vm, _SC("CPlayer"))
/* Constructors */
.Ctor()
.Ctor< SQInt32 >()

View File

@ -30,6 +30,11 @@ public:
*/
using RefType::Reference;
/* --------------------------------------------------------------------------------------------
* Construct a reference from a base reference.
*/
CPlayer(const Reference< CPlayer > & o) noexcept;
/* --------------------------------------------------------------------------------------------
* See if the referenced player instance is streamed for the specified player.
*/