mirror of
https://github.com/VCMP-SqMod/SqMod.git
synced 2025-06-15 22:57:12 +02:00
Initial implementation of the new event system.
Initial implementation of the new signals and slots class. Fixed command parsing which compared a pointer to a character. Buffer overflow fix in routines which used the limits from the entity tasks. Switched from Sqrat::Object to Sqrat::LightObj in most places to avoid the overhead of the VM pointer. Various other adjustments and improvements. The plugin is currently in a broken state and crashes at shutdown. The bug is unknown at this point.
This commit is contained in:
@ -20,7 +20,7 @@ SQInteger CBlip::SqGetNull(HSQUIRRELVM vm)
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
Object & CBlip::GetNull()
|
||||
LightObj & CBlip::GetNull()
|
||||
{
|
||||
return Core::Get().GetNullBlip();
|
||||
}
|
||||
@ -72,7 +72,7 @@ CBlip & CBlip::ApplyTag(const StackStrF & tag)
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
Object & CBlip::GetData()
|
||||
LightObj & CBlip::GetData()
|
||||
{
|
||||
// Validate the managed identifier
|
||||
Validate();
|
||||
@ -81,7 +81,7 @@ Object & CBlip::GetData()
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void CBlip::SetData(Object & data)
|
||||
void CBlip::SetData(LightObj & data)
|
||||
{
|
||||
// Validate the managed identifier
|
||||
Validate();
|
||||
@ -90,7 +90,7 @@ void CBlip::SetData(Object & data)
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
bool CBlip::Destroy(Int32 header, Object & payload)
|
||||
bool CBlip::Destroy(Int32 header, LightObj & payload)
|
||||
{
|
||||
// Validate the managed identifier
|
||||
Validate();
|
||||
@ -99,31 +99,16 @@ bool CBlip::Destroy(Int32 header, Object & payload)
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void CBlip::BindEvent(Int32 evid, Object & env, Function & func) const
|
||||
LightObj & CBlip::GetEvents() const
|
||||
{
|
||||
// Validate the managed identifier
|
||||
Validate();
|
||||
// Obtain the function instance called for this event
|
||||
Function & event = Core::Get().GetBlipEvent(m_ID, evid);
|
||||
// Is the specified callback function null?
|
||||
if (func.IsNull())
|
||||
{
|
||||
event.ReleaseGently(); // Then release the current callback
|
||||
}
|
||||
// Does this function need a custom environment?
|
||||
else if (env.IsNull())
|
||||
{
|
||||
event = func;
|
||||
}
|
||||
// Assign the specified environment and function
|
||||
else
|
||||
{
|
||||
event = Function(env.GetVM(), env, func.GetFunc());
|
||||
}
|
||||
// Return the associated event table
|
||||
return Core::Get().GetBlip(m_ID).mEvents;
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void CBlip::CustomEvent(Int32 header, Object & payload) const
|
||||
void CBlip::CustomEvent(Int32 header, LightObj & payload) const
|
||||
{
|
||||
// Validate the managed identifier
|
||||
Validate();
|
||||
@ -240,62 +225,62 @@ Int32 CBlip::GetColorA() const
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
static Object & Blip_CreateEx(Int32 world, Float32 x, Float32 y, Float32 z, Int32 scale,
|
||||
static LightObj & Blip_CreateEx(Int32 world, Float32 x, Float32 y, Float32 z, Int32 scale,
|
||||
Uint8 r, Uint8 g, Uint8 b, Uint8 a, Int32 sprid)
|
||||
{
|
||||
return Core::Get().NewBlip(-1, world, x, y, z, scale, SQMOD_PACK_RGBA(r, g, b, a), sprid,
|
||||
SQMOD_CREATE_DEFAULT, NullObject());
|
||||
SQMOD_CREATE_DEFAULT, NullLightObj());
|
||||
}
|
||||
|
||||
static Object & Blip_CreateEx(Int32 world, Float32 x, Float32 y, Float32 z, Int32 scale,
|
||||
static LightObj & Blip_CreateEx(Int32 world, Float32 x, Float32 y, Float32 z, Int32 scale,
|
||||
Uint8 r, Uint8 g, Uint8 b, Uint8 a, Int32 sprid,
|
||||
Int32 header, Object & payload)
|
||||
Int32 header, LightObj & payload)
|
||||
{
|
||||
return Core::Get().NewBlip(-1, world, x, y, z, scale, SQMOD_PACK_RGBA(r, g, b, a), sprid,
|
||||
header, payload);
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
static Object & Blip_CreateEx(Int32 index, Int32 world, Float32 x, Float32 y, Float32 z,
|
||||
static LightObj & Blip_CreateEx(Int32 index, Int32 world, Float32 x, Float32 y, Float32 z,
|
||||
Int32 scale, Uint8 r, Uint8 g, Uint8 b, Uint8 a, Int32 sprid)
|
||||
{
|
||||
return Core::Get().NewBlip(index, world, x, y, z, scale, SQMOD_PACK_RGBA(r, g, b, a), sprid,
|
||||
SQMOD_CREATE_DEFAULT, NullObject());
|
||||
SQMOD_CREATE_DEFAULT, NullLightObj());
|
||||
}
|
||||
|
||||
static Object & Blip_CreateEx(Int32 index, Int32 world, Float32 x, Float32 y, Float32 z, Int32 scale,
|
||||
static LightObj & Blip_CreateEx(Int32 index, Int32 world, Float32 x, Float32 y, Float32 z, Int32 scale,
|
||||
Uint8 r, Uint8 g, Uint8 b, Uint8 a, Int32 sprid,
|
||||
Int32 header, Object & payload)
|
||||
Int32 header, LightObj & payload)
|
||||
{
|
||||
return Core::Get().NewBlip(index, world, x, y, z, scale, SQMOD_PACK_RGBA(r, g, b, a), sprid,
|
||||
header, payload);
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
static Object & Blip_Create(Int32 world, const Vector3 & pos, Int32 scale, const Color4 & color,
|
||||
static LightObj & Blip_Create(Int32 world, const Vector3 & pos, Int32 scale, const Color4 & color,
|
||||
Int32 sprid)
|
||||
{
|
||||
return Core::Get().NewBlip(-1, world, pos.x, pos.y, pos.z, scale, color.GetRGBA(), sprid,
|
||||
SQMOD_CREATE_DEFAULT, NullObject());
|
||||
SQMOD_CREATE_DEFAULT, NullLightObj());
|
||||
}
|
||||
|
||||
static Object & Blip_Create(Int32 world, const Vector3 & pos, Int32 scale, const Color4 & color,
|
||||
Int32 sprid, Int32 header, Object & payload)
|
||||
static LightObj & Blip_Create(Int32 world, const Vector3 & pos, Int32 scale, const Color4 & color,
|
||||
Int32 sprid, Int32 header, LightObj & payload)
|
||||
{
|
||||
return Core::Get().NewBlip(-1, world, pos.x, pos.y, pos.z, scale, color.GetRGBA(), sprid,
|
||||
header, payload);
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
static Object & Blip_Create(Int32 index, Int32 world, const Vector3 & pos, Int32 scale,
|
||||
static LightObj & Blip_Create(Int32 index, Int32 world, const Vector3 & pos, Int32 scale,
|
||||
const Color4 & color, Int32 sprid)
|
||||
{
|
||||
return Core::Get().NewBlip(index, world, pos.x, pos.y, pos.z, scale, color.GetRGBA(), sprid,
|
||||
SQMOD_CREATE_DEFAULT, NullObject());
|
||||
SQMOD_CREATE_DEFAULT, NullLightObj());
|
||||
}
|
||||
|
||||
static Object & Blip_Create(Int32 index, Int32 world, const Vector3 & pos, Int32 scale,
|
||||
const Color4 & color, Int32 sprid, Int32 header, Object & payload)
|
||||
static LightObj & Blip_Create(Int32 index, Int32 world, const Vector3 & pos, Int32 scale,
|
||||
const Color4 & color, Int32 sprid, Int32 header, LightObj & payload)
|
||||
{
|
||||
return Core::Get().NewBlip(index, world, pos.x, pos.y, pos.z, scale, color.GetRGBA(), sprid,
|
||||
header, payload);
|
||||
@ -312,18 +297,18 @@ void Register_CBlip(HSQUIRRELVM vm)
|
||||
// Static Values
|
||||
.SetStaticValue(_SC("MaxID"), CBlip::Max)
|
||||
// Core Properties
|
||||
.Prop(_SC("On"), &CBlip::GetEvents)
|
||||
.Prop(_SC("ID"), &CBlip::GetID)
|
||||
.Prop(_SC("Tag"), &CBlip::GetTag, &CBlip::SetTag)
|
||||
.Prop(_SC("Data"), &CBlip::GetData, &CBlip::SetData)
|
||||
.Prop(_SC("Active"), &CBlip::IsActive)
|
||||
// Core Methods
|
||||
.Func(_SC("Bind"), &CBlip::BindEvent)
|
||||
.FmtFunc(_SC("SetTag"), &CBlip::ApplyTag)
|
||||
.Func(_SC("CustomEvent"), &CBlip::CustomEvent)
|
||||
// Core Overloads
|
||||
.Overload< bool (CBlip::*)(void) >(_SC("Destroy"), &CBlip::Destroy)
|
||||
.Overload< bool (CBlip::*)(Int32) >(_SC("Destroy"), &CBlip::Destroy)
|
||||
.Overload< bool (CBlip::*)(Int32, Object &) >(_SC("Destroy"), &CBlip::Destroy)
|
||||
.Overload< bool (CBlip::*)(Int32, LightObj &) >(_SC("Destroy"), &CBlip::Destroy)
|
||||
// Properties
|
||||
.Prop(_SC("World"), &CBlip::GetWorld)
|
||||
.Prop(_SC("Scale"), &CBlip::GetScale)
|
||||
@ -340,21 +325,21 @@ void Register_CBlip(HSQUIRRELVM vm)
|
||||
.Prop(_SC("Blue"), &CBlip::GetColorB)
|
||||
.Prop(_SC("Alpha"), &CBlip::GetColorA)
|
||||
// Static Overloads
|
||||
.StaticOverload< Object & (*)(Int32, Float32, Float32, Float32, Int32, Uint8, Uint8, Uint8, Uint8, Int32) >
|
||||
.StaticOverload< LightObj & (*)(Int32, Float32, Float32, Float32, Int32, Uint8, Uint8, Uint8, Uint8, Int32) >
|
||||
(_SC("CreateEx"), &Blip_CreateEx)
|
||||
.StaticOverload< Object & (*)(Int32, Float32, Float32, Float32, Int32, Uint8, Uint8, Uint8, Uint8, Int32, Int32, Object &) >
|
||||
.StaticOverload< LightObj & (*)(Int32, Float32, Float32, Float32, Int32, Uint8, Uint8, Uint8, Uint8, Int32, Int32, LightObj &) >
|
||||
(_SC("CreateEx"), &Blip_CreateEx)
|
||||
.StaticOverload< Object & (*)(Int32, Int32, Float32, Float32, Float32, Int32, Uint8, Uint8, Uint8, Uint8, Int32) >
|
||||
.StaticOverload< LightObj & (*)(Int32, Int32, Float32, Float32, Float32, Int32, Uint8, Uint8, Uint8, Uint8, Int32) >
|
||||
(_SC("CreateEx"), &Blip_CreateEx)
|
||||
.StaticOverload< Object & (*)(Int32, Int32, Float32, Float32, Float32, Int32, Uint8, Uint8, Uint8, Uint8, Int32, Int32, Object &) >
|
||||
.StaticOverload< LightObj & (*)(Int32, Int32, Float32, Float32, Float32, Int32, Uint8, Uint8, Uint8, Uint8, Int32, Int32, LightObj &) >
|
||||
(_SC("CreateEx"), &Blip_CreateEx)
|
||||
.StaticOverload< Object & (*)(Int32, const Vector3 &, Int32, const Color4 &, Int32) >
|
||||
.StaticOverload< LightObj & (*)(Int32, const Vector3 &, Int32, const Color4 &, Int32) >
|
||||
(_SC("Create"), &Blip_Create)
|
||||
.StaticOverload< Object & (*)(Int32, const Vector3 &, Int32, const Color4 &, Int32, Int32, Object &) >
|
||||
.StaticOverload< LightObj & (*)(Int32, const Vector3 &, Int32, const Color4 &, Int32, Int32, LightObj &) >
|
||||
(_SC("Create"), &Blip_Create)
|
||||
.StaticOverload< Object & (*)(Int32, Int32, const Vector3 &, Int32, const Color4 &, Int32) >
|
||||
.StaticOverload< LightObj & (*)(Int32, Int32, const Vector3 &, Int32, const Color4 &, Int32) >
|
||||
(_SC("Create"), &Blip_Create)
|
||||
.StaticOverload< Object & (*)(Int32, Int32, const Vector3 &, Int32, const Color4 &, Int32, Int32, Object &) >
|
||||
.StaticOverload< LightObj & (*)(Int32, Int32, const Vector3 &, Int32, const Color4 &, Int32, Int32, LightObj &) >
|
||||
(_SC("Create"), &Blip_Create)
|
||||
// Raw Squirrel Methods
|
||||
.SquirrelFunc(_SC("NullInst"), &CBlip::SqGetNull)
|
||||
|
@ -20,17 +20,17 @@ private:
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Identifier of the managed entity.
|
||||
*/
|
||||
Int32 m_ID;
|
||||
Int32 m_ID;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* User tag associated with this instance.
|
||||
*/
|
||||
String m_Tag;
|
||||
String m_Tag;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* User data associated with this instance.
|
||||
*/
|
||||
Object m_Data;
|
||||
LightObj m_Data;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Base constructor.
|
||||
@ -93,7 +93,7 @@ public:
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Retrieve the associated null entity instance.
|
||||
*/
|
||||
static Object & GetNull();
|
||||
static LightObj & GetNull();
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Retrieve the identifier of the entity managed by this instance.
|
||||
@ -129,19 +129,19 @@ public:
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Retrieve the associated user data.
|
||||
*/
|
||||
Object & GetData();
|
||||
LightObj & GetData();
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Modify the associated user data.
|
||||
*/
|
||||
void SetData(Object & data);
|
||||
void SetData(LightObj & data);
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Destroy the managed blip entity.
|
||||
*/
|
||||
bool Destroy()
|
||||
{
|
||||
return Destroy(0, NullObject());
|
||||
return Destroy(0, NullLightObj());
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
@ -149,23 +149,23 @@ public:
|
||||
*/
|
||||
bool Destroy(Int32 header)
|
||||
{
|
||||
return Destroy(header, NullObject());
|
||||
return Destroy(header, NullLightObj());
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Destroy the managed blip entity.
|
||||
*/
|
||||
bool Destroy(Int32 header, Object & payload);
|
||||
bool Destroy(Int32 header, LightObj & payload);
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Bind to an event supported by this entity type.
|
||||
* Retrieve the events table of this entity.
|
||||
*/
|
||||
void BindEvent(Int32 evid, Object & env, Function & func) const;
|
||||
LightObj & GetEvents() const;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Emit a custom event for the managed entity
|
||||
*/
|
||||
void CustomEvent(Int32 header, Object & payload) const;
|
||||
void CustomEvent(Int32 header, LightObj & payload) const;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Retrieve the world in which the referenced blip entity exists.
|
||||
|
@ -33,7 +33,7 @@ SQInteger CCheckpoint::SqGetNull(HSQUIRRELVM vm)
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
Object & CCheckpoint::GetNull()
|
||||
LightObj & CCheckpoint::GetNull()
|
||||
{
|
||||
return Core::Get().GetNullCheckpoint();
|
||||
}
|
||||
@ -85,7 +85,7 @@ CCheckpoint & CCheckpoint::ApplyTag(const StackStrF & tag)
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
Object & CCheckpoint::GetData()
|
||||
LightObj & CCheckpoint::GetData()
|
||||
{
|
||||
// Validate the managed identifier
|
||||
Validate();
|
||||
@ -94,7 +94,7 @@ Object & CCheckpoint::GetData()
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void CCheckpoint::SetData(Object & data)
|
||||
void CCheckpoint::SetData(LightObj & data)
|
||||
{
|
||||
// Validate the managed identifier
|
||||
Validate();
|
||||
@ -103,7 +103,7 @@ void CCheckpoint::SetData(Object & data)
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
bool CCheckpoint::Destroy(Int32 header, Object & payload)
|
||||
bool CCheckpoint::Destroy(Int32 header, LightObj & payload)
|
||||
{
|
||||
// Validate the managed identifier
|
||||
Validate();
|
||||
@ -112,31 +112,16 @@ bool CCheckpoint::Destroy(Int32 header, Object & payload)
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void CCheckpoint::BindEvent(Int32 evid, Object & env, Function & func) const
|
||||
LightObj & CCheckpoint::GetEvents() const
|
||||
{
|
||||
// Validate the managed identifier
|
||||
Validate();
|
||||
// Obtain the function instance called for this event
|
||||
Function & event = Core::Get().GetCheckpointEvent(m_ID, evid);
|
||||
// Is the specified callback function null?
|
||||
if (func.IsNull())
|
||||
{
|
||||
event.ReleaseGently(); // Then release the current callback
|
||||
}
|
||||
// Does this function need a custom environment?
|
||||
else if (env.IsNull())
|
||||
{
|
||||
event = func;
|
||||
}
|
||||
// Assign the specified environment and function
|
||||
else
|
||||
{
|
||||
event = Function(env.GetVM(), env, func.GetFunc());
|
||||
}
|
||||
// Return the associated event table
|
||||
return Core::Get().GetCheckpoint(m_ID).mEvents;
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void CCheckpoint::CustomEvent(Int32 header, Object & payload) const
|
||||
void CCheckpoint::CustomEvent(Int32 header, LightObj & payload) const
|
||||
{
|
||||
// Validate the managed identifier
|
||||
Validate();
|
||||
@ -302,7 +287,7 @@ void CCheckpoint::SetRadius(Float32 radius)
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
Object & CCheckpoint::GetOwner() const
|
||||
LightObj & CCheckpoint::GetOwner() const
|
||||
{
|
||||
// Validate the managed identifier
|
||||
Validate();
|
||||
@ -488,32 +473,32 @@ void CCheckpoint::SetColorA(Int32 a) const
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
static Object & Checkpoint_CreateEx(Int32 world, bool sphere, Float32 x, Float32 y, Float32 z,
|
||||
static LightObj & Checkpoint_CreateEx(Int32 world, bool sphere, Float32 x, Float32 y, Float32 z,
|
||||
Uint8 r, Uint8 g, Uint8 b, Uint8 a, Float32 radius)
|
||||
{
|
||||
return Core::Get().NewCheckpoint(-1, world, sphere, x, y, z, r, g, b, a, radius,
|
||||
SQMOD_CREATE_DEFAULT, NullObject());
|
||||
SQMOD_CREATE_DEFAULT, NullLightObj());
|
||||
}
|
||||
|
||||
static Object & Checkpoint_CreateEx(Int32 world, bool sphere, Float32 x, Float32 y, Float32 z,
|
||||
static LightObj & Checkpoint_CreateEx(Int32 world, bool sphere, Float32 x, Float32 y, Float32 z,
|
||||
Uint8 r, Uint8 g, Uint8 b, Uint8 a, Float32 radius,
|
||||
Int32 header, Object & payload)
|
||||
Int32 header, LightObj & payload)
|
||||
{
|
||||
return Core::Get().NewCheckpoint(-1, world, sphere, x, y, z, r, g, b, a,
|
||||
radius, header, payload);
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
static Object & Checkpoint_Create(Int32 world, bool sphere, const Vector3 & pos,
|
||||
static LightObj & Checkpoint_Create(Int32 world, bool sphere, const Vector3 & pos,
|
||||
const Color4 & color, Float32 radius)
|
||||
{
|
||||
return Core::Get().NewCheckpoint(-1, world, sphere, pos.x, pos.y, pos.z,
|
||||
color.r, color.g, color.b, color.a, radius,
|
||||
SQMOD_CREATE_DEFAULT, NullObject());
|
||||
SQMOD_CREATE_DEFAULT, NullLightObj());
|
||||
}
|
||||
|
||||
static Object & Checkpoint_Create(Int32 world, bool sphere, const Vector3 & pos,
|
||||
const Color4 & color, Float32 radius, Int32 header, Object & payload)
|
||||
static LightObj & Checkpoint_Create(Int32 world, bool sphere, const Vector3 & pos,
|
||||
const Color4 & color, Float32 radius, Int32 header, LightObj & payload)
|
||||
{
|
||||
return Core::Get().NewCheckpoint(-1, world, sphere, pos.x, pos.y, pos.z,
|
||||
color.r, color.g, color.b, color.a, radius, header, payload);
|
||||
@ -530,18 +515,18 @@ void Register_CCheckpoint(HSQUIRRELVM vm)
|
||||
// Static Values
|
||||
.SetStaticValue(_SC("MaxID"), CCheckpoint::Max)
|
||||
// Core Properties
|
||||
.Prop(_SC("On"), &CCheckpoint::GetEvents)
|
||||
.Prop(_SC("ID"), &CCheckpoint::GetID)
|
||||
.Prop(_SC("Tag"), &CCheckpoint::GetTag, &CCheckpoint::SetTag)
|
||||
.Prop(_SC("Data"), &CCheckpoint::GetData, &CCheckpoint::SetData)
|
||||
.Prop(_SC("Active"), &CCheckpoint::IsActive)
|
||||
// Core Methods
|
||||
.Func(_SC("Bind"), &CCheckpoint::BindEvent)
|
||||
.FmtFunc(_SC("SetTag"), &CCheckpoint::ApplyTag)
|
||||
.Func(_SC("CustomEvent"), &CCheckpoint::CustomEvent)
|
||||
// Core Overloads
|
||||
.Overload< bool (CCheckpoint::*)(void) >(_SC("Destroy"), &CCheckpoint::Destroy)
|
||||
.Overload< bool (CCheckpoint::*)(Int32) >(_SC("Destroy"), &CCheckpoint::Destroy)
|
||||
.Overload< bool (CCheckpoint::*)(Int32, Object &) >(_SC("Destroy"), &CCheckpoint::Destroy)
|
||||
.Overload< bool (CCheckpoint::*)(Int32, LightObj &) >(_SC("Destroy"), &CCheckpoint::Destroy)
|
||||
// Properties
|
||||
.Prop(_SC("Sphere"), &CCheckpoint::IsSphere)
|
||||
.Prop(_SC("World"), &CCheckpoint::GetWorld, &CCheckpoint::SetWorld)
|
||||
@ -569,13 +554,13 @@ void Register_CCheckpoint(HSQUIRRELVM vm)
|
||||
.Overload< void (CCheckpoint::*)(Uint8, Uint8, Uint8, Uint8) const >
|
||||
(_SC("SetColor"), &CCheckpoint::SetColorEx)
|
||||
// Static Overloads
|
||||
.StaticOverload< Object & (*)(Int32, bool, Float32, Float32, Float32, Uint8, Uint8, Uint8, Uint8, Float32) >
|
||||
.StaticOverload< LightObj & (*)(Int32, bool, Float32, Float32, Float32, Uint8, Uint8, Uint8, Uint8, Float32) >
|
||||
(_SC("CreateEx"), &Checkpoint_CreateEx)
|
||||
.StaticOverload< Object & (*)(Int32, bool, Float32, Float32, Float32, Uint8, Uint8, Uint8, Uint8, Float32, Int32, Object &) >
|
||||
.StaticOverload< LightObj & (*)(Int32, bool, Float32, Float32, Float32, Uint8, Uint8, Uint8, Uint8, Float32, Int32, LightObj &) >
|
||||
(_SC("CreateEx"), &Checkpoint_CreateEx)
|
||||
.StaticOverload< Object & (*)(Int32, bool, const Vector3 &, const Color4 &, Float32) >
|
||||
.StaticOverload< LightObj & (*)(Int32, bool, const Vector3 &, const Color4 &, Float32) >
|
||||
(_SC("Create"), &Checkpoint_Create)
|
||||
.StaticOverload< Object & (*)(Int32, bool, const Vector3 &, const Color4 &, Float32, Int32, Object &) >
|
||||
.StaticOverload< LightObj & (*)(Int32, bool, const Vector3 &, const Color4 &, Float32, Int32, LightObj &) >
|
||||
(_SC("Create"), &Checkpoint_Create)
|
||||
// Raw Squirrel Methods
|
||||
.SquirrelFunc(_SC("NullInst"), &CCheckpoint::SqGetNull)
|
||||
|
@ -36,22 +36,22 @@ private:
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Identifier of the managed entity.
|
||||
*/
|
||||
Int32 m_ID;
|
||||
Int32 m_ID;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* User tag associated with this instance.
|
||||
*/
|
||||
String m_Tag;
|
||||
String m_Tag;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* User data associated with this instance.
|
||||
*/
|
||||
Object m_Data;
|
||||
LightObj m_Data;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Prevent events from triggering themselves.
|
||||
*/
|
||||
Uint32 m_CircularLocks;
|
||||
Uint32 m_CircularLocks;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Base constructor.
|
||||
@ -114,7 +114,7 @@ public:
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Retrieve the associated null entity instance.
|
||||
*/
|
||||
static Object & GetNull();
|
||||
static LightObj & GetNull();
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Retrieve the identifier of the entity managed by this instance.
|
||||
@ -150,19 +150,19 @@ public:
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Retrieve the associated user data.
|
||||
*/
|
||||
Object & GetData();
|
||||
LightObj & GetData();
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Modify the associated user data.
|
||||
*/
|
||||
void SetData(Object & data);
|
||||
void SetData(LightObj & data);
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Destroy the managed checkpoint entity.
|
||||
*/
|
||||
bool Destroy()
|
||||
{
|
||||
return Destroy(0, NullObject());
|
||||
return Destroy(0, NullLightObj());
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
@ -170,23 +170,23 @@ public:
|
||||
*/
|
||||
bool Destroy(Int32 header)
|
||||
{
|
||||
return Destroy(header, NullObject());
|
||||
return Destroy(header, NullLightObj());
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Destroy the managed checkpoint entity.
|
||||
*/
|
||||
bool Destroy(Int32 header, Object & payload);
|
||||
bool Destroy(Int32 header, LightObj & payload);
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Bind to an event supported by this entity type.
|
||||
* Retrieve the events table of this entity.
|
||||
*/
|
||||
void BindEvent(Int32 evid, Object & env, Function & func) const;
|
||||
LightObj & GetEvents() const;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Emit a custom event for the managed entity
|
||||
*/
|
||||
void CustomEvent(Int32 header, Object & payload) const;
|
||||
void CustomEvent(Int32 header, LightObj & payload) const;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* See if the managed checkpoint entity is streamed for the specified player.
|
||||
@ -256,7 +256,7 @@ public:
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Retrieve the owner of the managed checkpoint entity.
|
||||
*/
|
||||
Object & GetOwner() const;
|
||||
LightObj & GetOwner() const;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Retrieve the owner identifier of the managed checkpoint entity.
|
||||
|
@ -20,7 +20,7 @@ SQInteger CKeybind::SqGetNull(HSQUIRRELVM vm)
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
Object & CKeybind::GetNull()
|
||||
LightObj & CKeybind::GetNull()
|
||||
{
|
||||
return Core::Get().GetNullKeybind();
|
||||
}
|
||||
@ -72,7 +72,7 @@ CKeybind & CKeybind::ApplyTag(const StackStrF & tag)
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
Object & CKeybind::GetData()
|
||||
LightObj & CKeybind::GetData()
|
||||
{
|
||||
// Validate the managed identifier
|
||||
Validate();
|
||||
@ -81,7 +81,7 @@ Object & CKeybind::GetData()
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void CKeybind::SetData(Object & data)
|
||||
void CKeybind::SetData(LightObj & data)
|
||||
{
|
||||
// Validate the managed identifier
|
||||
Validate();
|
||||
@ -90,7 +90,7 @@ void CKeybind::SetData(Object & data)
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
bool CKeybind::Destroy(Int32 header, Object & payload)
|
||||
bool CKeybind::Destroy(Int32 header, LightObj & payload)
|
||||
{
|
||||
// Validate the managed identifier
|
||||
Validate();
|
||||
@ -99,31 +99,16 @@ bool CKeybind::Destroy(Int32 header, Object & payload)
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void CKeybind::BindEvent(Int32 evid, Object & env, Function & func) const
|
||||
LightObj & CKeybind::GetEvents() const
|
||||
{
|
||||
// Validate the managed identifier
|
||||
Validate();
|
||||
// Obtain the function instance called for this event
|
||||
Function & event = Core::Get().GetKeybindEvent(m_ID, evid);
|
||||
// Is the specified callback function null?
|
||||
if (func.IsNull())
|
||||
{
|
||||
event.ReleaseGently(); // Then release the current callback
|
||||
}
|
||||
// Does this function need a custom environment?
|
||||
else if (env.IsNull())
|
||||
{
|
||||
event = func;
|
||||
}
|
||||
// Assign the specified environment and function
|
||||
else
|
||||
{
|
||||
event = Function(env.GetVM(), env, func.GetFunc());
|
||||
}
|
||||
// Return the associated event table
|
||||
return Core::Get().GetKeybind(m_ID).mEvents;
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void CKeybind::CustomEvent(Int32 header, Object & payload) const
|
||||
void CKeybind::CustomEvent(Int32 header, LightObj & payload) const
|
||||
{
|
||||
// Validate the managed identifier
|
||||
Validate();
|
||||
@ -168,28 +153,28 @@ bool CKeybind::IsRelease() const
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
static Object & Keybind_CreateEx(Int32 slot, bool release, Int32 primary, Int32 secondary,
|
||||
static LightObj & Keybind_CreateEx(Int32 slot, bool release, Int32 primary, Int32 secondary,
|
||||
Int32 alternative)
|
||||
{
|
||||
return Core::Get().NewKeybind(slot, release, primary, secondary, alternative,
|
||||
SQMOD_CREATE_DEFAULT, NullObject());
|
||||
SQMOD_CREATE_DEFAULT, NullLightObj());
|
||||
}
|
||||
|
||||
static Object & Keybind_CreateEx(Int32 slot, bool release, Int32 primary, Int32 secondary,
|
||||
Int32 alternative, Int32 header, Object & payload)
|
||||
static LightObj & Keybind_CreateEx(Int32 slot, bool release, Int32 primary, Int32 secondary,
|
||||
Int32 alternative, Int32 header, LightObj & payload)
|
||||
{
|
||||
return Core::Get().NewKeybind(slot, release, primary, secondary, alternative, header, payload);
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
static Object & Keybind_Create(bool release, Int32 primary, Int32 secondary, Int32 alternative)
|
||||
static LightObj & Keybind_Create(bool release, Int32 primary, Int32 secondary, Int32 alternative)
|
||||
{
|
||||
return Core::Get().NewKeybind(-1, release, primary, secondary, alternative,
|
||||
SQMOD_CREATE_DEFAULT, NullObject());
|
||||
SQMOD_CREATE_DEFAULT, NullLightObj());
|
||||
}
|
||||
|
||||
static Object & Keybind_Create(bool release, Int32 primary, Int32 secondary, Int32 alternative,
|
||||
Int32 header, Object & payload)
|
||||
static LightObj & Keybind_Create(bool release, Int32 primary, Int32 secondary, Int32 alternative,
|
||||
Int32 header, LightObj & payload)
|
||||
{
|
||||
return Core::Get().NewKeybind(-1, release, primary, secondary, alternative, header, payload);
|
||||
}
|
||||
@ -211,18 +196,18 @@ void Register_CKeybind(HSQUIRRELVM vm)
|
||||
// Static Values
|
||||
.SetStaticValue(_SC("MaxID"), CKeybind::Max)
|
||||
// Core Properties
|
||||
.Prop(_SC("On"), &CKeybind::GetEvents)
|
||||
.Prop(_SC("ID"), &CKeybind::GetID)
|
||||
.Prop(_SC("Tag"), &CKeybind::GetTag, &CKeybind::SetTag)
|
||||
.Prop(_SC("Data"), &CKeybind::GetData, &CKeybind::SetData)
|
||||
.Prop(_SC("Active"), &CKeybind::IsActive)
|
||||
// Core Methods
|
||||
.Func(_SC("Bind"), &CKeybind::BindEvent)
|
||||
.FmtFunc(_SC("SetTag"), &CKeybind::ApplyTag)
|
||||
.Func(_SC("CustomEvent"), &CKeybind::CustomEvent)
|
||||
// Core Overloads
|
||||
.Overload< bool (CKeybind::*)(void) >(_SC("Destroy"), &CKeybind::Destroy)
|
||||
.Overload< bool (CKeybind::*)(Int32) >(_SC("Destroy"), &CKeybind::Destroy)
|
||||
.Overload< bool (CKeybind::*)(Int32, Object &) >(_SC("Destroy"), &CKeybind::Destroy)
|
||||
.Overload< bool (CKeybind::*)(Int32, LightObj &) >(_SC("Destroy"), &CKeybind::Destroy)
|
||||
// Properties
|
||||
.Prop(_SC("First"), &CKeybind::GetFirst)
|
||||
.Prop(_SC("Second"), &CKeybind::GetSecond)
|
||||
@ -231,13 +216,13 @@ void Register_CKeybind(HSQUIRRELVM vm)
|
||||
// Static Functions
|
||||
.StaticFunc(_SC("UnusedSlot"), &Keybind_UnusedSlot)
|
||||
// Static Overloads
|
||||
.StaticOverload< Object & (*)(Int32, bool, Int32, Int32, Int32) >
|
||||
.StaticOverload< LightObj & (*)(Int32, bool, Int32, Int32, Int32) >
|
||||
(_SC("CreateEx"), &Keybind_CreateEx)
|
||||
.StaticOverload< Object & (*)(Int32, bool, Int32, Int32, Int32, Int32, Object &) >
|
||||
.StaticOverload< LightObj & (*)(Int32, bool, Int32, Int32, Int32, Int32, LightObj &) >
|
||||
(_SC("CreateEx"), &Keybind_CreateEx)
|
||||
.StaticOverload< Object & (*)(bool, Int32, Int32, Int32) >
|
||||
.StaticOverload< LightObj & (*)(bool, Int32, Int32, Int32) >
|
||||
(_SC("Create"), &Keybind_Create)
|
||||
.StaticOverload< Object & (*)(bool, Int32, Int32, Int32, Int32, Object &) >
|
||||
.StaticOverload< LightObj & (*)(bool, Int32, Int32, Int32, Int32, LightObj &) >
|
||||
(_SC("Create"), &Keybind_Create)
|
||||
// Raw Squirrel Methods
|
||||
.SquirrelFunc(_SC("NullInst"), &CKeybind::SqGetNull)
|
||||
|
@ -20,17 +20,17 @@ private:
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Identifier of the managed entity.
|
||||
*/
|
||||
Int32 m_ID;
|
||||
Int32 m_ID;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* User tag associated with this instance.
|
||||
*/
|
||||
String m_Tag;
|
||||
String m_Tag;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* User data associated with this instance.
|
||||
*/
|
||||
Object m_Data;
|
||||
LightObj m_Data;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Base constructor.
|
||||
@ -93,7 +93,7 @@ public:
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Retrieve the associated null entity instance.
|
||||
*/
|
||||
static Object & GetNull();
|
||||
static LightObj & GetNull();
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Retrieve the identifier of the entity managed by this instance.
|
||||
@ -129,19 +129,19 @@ public:
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Retrieve the associated user data.
|
||||
*/
|
||||
Object & GetData();
|
||||
LightObj & GetData();
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Modify the associated user data.
|
||||
*/
|
||||
void SetData(Object & data);
|
||||
void SetData(LightObj & data);
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Destroy the managed destroy entity.
|
||||
*/
|
||||
bool Destroy()
|
||||
{
|
||||
return Destroy(0, NullObject());
|
||||
return Destroy(0, NullLightObj());
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
@ -149,23 +149,23 @@ public:
|
||||
*/
|
||||
bool Destroy(Int32 header)
|
||||
{
|
||||
return Destroy(header, NullObject());
|
||||
return Destroy(header, NullLightObj());
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Destroy the managed destroy entity.
|
||||
*/
|
||||
bool Destroy(Int32 header, Object & payload);
|
||||
bool Destroy(Int32 header, LightObj & payload);
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Bind to an event supported by this entity type.
|
||||
* Retrieve the events table of this entity.
|
||||
*/
|
||||
void BindEvent(Int32 evid, Object & env, Function & func) const;
|
||||
LightObj & GetEvents() const;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Emit a custom event for the managed entity
|
||||
*/
|
||||
void CustomEvent(Int32 header, Object & payload) const;
|
||||
void CustomEvent(Int32 header, LightObj & payload) const;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Retrieve the first key code of the managed keybind entity.
|
||||
|
@ -27,7 +27,7 @@ SQInteger CObject::SqGetNull(HSQUIRRELVM vm)
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
Object & CObject::GetNull()
|
||||
LightObj & CObject::GetNull()
|
||||
{
|
||||
return Core::Get().GetNullObject();
|
||||
}
|
||||
@ -85,7 +85,7 @@ CObject & CObject::ApplyTag(const StackStrF & tag)
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
Object & CObject::GetData()
|
||||
LightObj & CObject::GetData()
|
||||
{
|
||||
// Validate the managed identifier
|
||||
Validate();
|
||||
@ -94,7 +94,7 @@ Object & CObject::GetData()
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void CObject::SetData(Object & data)
|
||||
void CObject::SetData(LightObj & data)
|
||||
{
|
||||
// Validate the managed identifier
|
||||
Validate();
|
||||
@ -103,7 +103,7 @@ void CObject::SetData(Object & data)
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
bool CObject::Destroy(Int32 header, Object & payload)
|
||||
bool CObject::Destroy(Int32 header, LightObj & payload)
|
||||
{
|
||||
// Validate the managed identifier
|
||||
Validate();
|
||||
@ -112,31 +112,16 @@ bool CObject::Destroy(Int32 header, Object & payload)
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void CObject::BindEvent(Int32 evid, Object & env, Function & func) const
|
||||
LightObj & CObject::GetEvents() const
|
||||
{
|
||||
// Validate the managed identifier
|
||||
Validate();
|
||||
// Obtain the function instance called for this event
|
||||
Function & event = Core::Get().GetObjectEvent(m_ID, evid);
|
||||
// Is the specified callback function null?
|
||||
if (func.IsNull())
|
||||
{
|
||||
event.ReleaseGently(); // Then release the current callback
|
||||
}
|
||||
// Does this function need a custom environment?
|
||||
else if (env.IsNull())
|
||||
{
|
||||
event = func;
|
||||
}
|
||||
// Assign the specified environment and function
|
||||
else
|
||||
{
|
||||
event = Function(env.GetVM(), env, func.GetFunc());
|
||||
}
|
||||
// Return the associated event table
|
||||
return Core::Get().GetObject(m_ID).mEvents;
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void CObject::CustomEvent(Int32 header, Object & payload) const
|
||||
void CObject::CustomEvent(Int32 header, LightObj & payload) const
|
||||
{
|
||||
// Validate the managed identifier
|
||||
Validate();
|
||||
@ -854,27 +839,27 @@ void CObject::RotateByEulerZ(Float32 z) const
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
static Object & Object_CreateEx(Int32 model, Int32 world, Float32 x, Float32 y, Float32 z,
|
||||
static LightObj & Object_CreateEx(Int32 model, Int32 world, Float32 x, Float32 y, Float32 z,
|
||||
Int32 alpha)
|
||||
{
|
||||
return Core::Get().NewObject(model, world, x, y, z, alpha, SQMOD_CREATE_DEFAULT, NullObject());
|
||||
return Core::Get().NewObject(model, world, x, y, z, alpha, SQMOD_CREATE_DEFAULT, NullLightObj());
|
||||
}
|
||||
|
||||
static Object & Object_CreateEx(Int32 model, Int32 world, Float32 x, Float32 y, Float32 z,
|
||||
Int32 alpha, Int32 header, Object & payload)
|
||||
static LightObj & Object_CreateEx(Int32 model, Int32 world, Float32 x, Float32 y, Float32 z,
|
||||
Int32 alpha, Int32 header, LightObj & payload)
|
||||
{
|
||||
return Core::Get().NewObject(model, world, x, y, z, alpha, header, payload);
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
static Object & Object_Create(Int32 model, Int32 world, const Vector3 & pos, Int32 alpha)
|
||||
static LightObj & Object_Create(Int32 model, Int32 world, const Vector3 & pos, Int32 alpha)
|
||||
{
|
||||
return Core::Get().NewObject(model, world, pos.x, pos.y, pos.z, alpha,
|
||||
SQMOD_CREATE_DEFAULT, NullObject());
|
||||
SQMOD_CREATE_DEFAULT, NullLightObj());
|
||||
}
|
||||
|
||||
static Object & Object_Create(Int32 model, Int32 world, const Vector3 & pos, Int32 alpha,
|
||||
Int32 header, Object & payload)
|
||||
static LightObj & Object_Create(Int32 model, Int32 world, const Vector3 & pos, Int32 alpha,
|
||||
Int32 header, LightObj & payload)
|
||||
{
|
||||
return Core::Get().NewObject(model, world, pos.x, pos.y, pos.z, alpha, header, payload);
|
||||
}
|
||||
@ -897,18 +882,18 @@ void Register_CObject(HSQUIRRELVM vm)
|
||||
.Var(_SC("RotateToEulerDuration"), &CObject::mRotateToEulerDuration)
|
||||
.Var(_SC("RotateByEulerDuration"), &CObject::mRotateByEulerDuration)
|
||||
// Core Properties
|
||||
.Prop(_SC("On"), &CObject::GetEvents)
|
||||
.Prop(_SC("ID"), &CObject::GetID)
|
||||
.Prop(_SC("Tag"), &CObject::GetTag, &CObject::SetTag)
|
||||
.Prop(_SC("Data"), &CObject::GetData, &CObject::SetData)
|
||||
.Prop(_SC("Active"), &CObject::IsActive)
|
||||
// Core Methods
|
||||
.Func(_SC("Bind"), &CObject::BindEvent)
|
||||
.FmtFunc(_SC("SetTag"), &CObject::ApplyTag)
|
||||
.Func(_SC("CustomEvent"), &CObject::CustomEvent)
|
||||
// Core Overloads
|
||||
.Overload< bool (CObject::*)(void) >(_SC("Destroy"), &CObject::Destroy)
|
||||
.Overload< bool (CObject::*)(Int32) >(_SC("Destroy"), &CObject::Destroy)
|
||||
.Overload< bool (CObject::*)(Int32, Object &) >(_SC("Destroy"), &CObject::Destroy)
|
||||
.Overload< bool (CObject::*)(Int32, LightObj &) >(_SC("Destroy"), &CObject::Destroy)
|
||||
// Properties
|
||||
.Prop(_SC("Model"), &CObject::GetModel)
|
||||
.Prop(_SC("World"), &CObject::GetWorld, &CObject::SetWorld)
|
||||
@ -982,13 +967,13 @@ void Register_CObject(HSQUIRRELVM vm)
|
||||
.Overload< void (CObject::*)(Float32, Float32, Float32, Uint32) const >
|
||||
(_SC("RotateByEuler"), &CObject::RotateByEulerEx)
|
||||
// Static Overloads
|
||||
.StaticOverload< Object & (*)(Int32, Int32, Float32, Float32, Float32, Int32) >
|
||||
.StaticOverload< LightObj & (*)(Int32, Int32, Float32, Float32, Float32, Int32) >
|
||||
(_SC("CreateEx"), &Object_CreateEx)
|
||||
.StaticOverload< Object & (*)(Int32, Int32, Float32, Float32, Float32, Int32, Int32, Object &) >
|
||||
.StaticOverload< LightObj & (*)(Int32, Int32, Float32, Float32, Float32, Int32, Int32, LightObj &) >
|
||||
(_SC("CreateEx"), &Object_CreateEx)
|
||||
.StaticOverload< Object & (*)(Int32, Int32, const Vector3 &, Int32) >
|
||||
.StaticOverload< LightObj & (*)(Int32, Int32, const Vector3 &, Int32) >
|
||||
(_SC("Create"), &Object_Create)
|
||||
.StaticOverload< Object & (*)(Int32, Int32, const Vector3 &, Int32, Int32, Object &) >
|
||||
.StaticOverload< LightObj & (*)(Int32, Int32, const Vector3 &, Int32, Int32, LightObj &) >
|
||||
(_SC("Create"), &Object_Create)
|
||||
// Raw Squirrel Methods
|
||||
.SquirrelFunc(_SC("NullInst"), &CObject::SqGetNull)
|
||||
|
@ -34,22 +34,22 @@ private:
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Identifier of the managed entity.
|
||||
*/
|
||||
Int32 m_ID;
|
||||
Int32 m_ID;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* User tag associated with this instance.
|
||||
*/
|
||||
String m_Tag;
|
||||
String m_Tag;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* User data associated with this instance.
|
||||
*/
|
||||
Object m_Data;
|
||||
LightObj m_Data;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Prevent events from triggering themselves.
|
||||
*/
|
||||
Uint32 m_CircularLocks;
|
||||
Uint32 m_CircularLocks;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Base constructor.
|
||||
@ -130,7 +130,7 @@ public:
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Retrieve the associated null entity instance.
|
||||
*/
|
||||
static Object & GetNull();
|
||||
static LightObj & GetNull();
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Retrieve the identifier of the entity managed by this instance.
|
||||
@ -166,19 +166,19 @@ public:
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Retrieve the associated user data.
|
||||
*/
|
||||
Object & GetData();
|
||||
LightObj & GetData();
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Modify the associated user data.
|
||||
*/
|
||||
void SetData(Object & data);
|
||||
void SetData(LightObj & data);
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Destroy the managed object entity.
|
||||
*/
|
||||
bool Destroy()
|
||||
{
|
||||
return Destroy(0, NullObject());
|
||||
return Destroy(0, NullLightObj());
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
@ -186,23 +186,23 @@ public:
|
||||
*/
|
||||
bool Destroy(Int32 header)
|
||||
{
|
||||
return Destroy(header, NullObject());
|
||||
return Destroy(header, NullLightObj());
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Destroy the managed object entity.
|
||||
*/
|
||||
bool Destroy(Int32 header, Object & payload);
|
||||
bool Destroy(Int32 header, LightObj & payload);
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Bind to an event supported by this entity type.
|
||||
* Retrieve the events table of this entity.
|
||||
*/
|
||||
void BindEvent(Int32 evid, Object & env, Function & func) const;
|
||||
LightObj & GetEvents() const;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Emit a custom event for the managed entity
|
||||
*/
|
||||
void CustomEvent(Int32 header, Object & payload) const;
|
||||
void CustomEvent(Int32 header, LightObj & payload) const;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* See if the managed object entity is streamed for the specified player.
|
||||
|
@ -25,7 +25,7 @@ SQInteger CPickup::SqGetNull(HSQUIRRELVM vm)
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
Object & CPickup::GetNull()
|
||||
LightObj & CPickup::GetNull()
|
||||
{
|
||||
return Core::Get().GetNullPickup();
|
||||
}
|
||||
@ -77,7 +77,7 @@ CPickup & CPickup::ApplyTag(const StackStrF & tag)
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
Object & CPickup::GetData()
|
||||
LightObj & CPickup::GetData()
|
||||
{
|
||||
// Validate the managed identifier
|
||||
Validate();
|
||||
@ -86,7 +86,7 @@ Object & CPickup::GetData()
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void CPickup::SetData(Object & data)
|
||||
void CPickup::SetData(LightObj & data)
|
||||
{
|
||||
// Validate the managed identifier
|
||||
Validate();
|
||||
@ -95,7 +95,7 @@ void CPickup::SetData(Object & data)
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
bool CPickup::Destroy(Int32 header, Object & payload)
|
||||
bool CPickup::Destroy(Int32 header, LightObj & payload)
|
||||
{
|
||||
// Validate the managed identifier
|
||||
Validate();
|
||||
@ -104,31 +104,16 @@ bool CPickup::Destroy(Int32 header, Object & payload)
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void CPickup::BindEvent(Int32 evid, Object & env, Function & func) const
|
||||
LightObj & CPickup::GetEvents() const
|
||||
{
|
||||
// Validate the managed identifier
|
||||
Validate();
|
||||
// Obtain the function instance called for this event
|
||||
Function & event = Core::Get().GetPickupEvent(m_ID, evid);
|
||||
// Is the specified callback function null?
|
||||
if (func.IsNull())
|
||||
{
|
||||
event.ReleaseGently(); // Then release the current callback
|
||||
}
|
||||
// Does this function need a custom environment?
|
||||
else if (env.IsNull())
|
||||
{
|
||||
event = func;
|
||||
}
|
||||
// Assign the specified environment and function
|
||||
else
|
||||
{
|
||||
event = Function(env.GetVM(), env, func.GetFunc());
|
||||
}
|
||||
// Return the associated event table
|
||||
return Core::Get().GetPickup(m_ID).mEvents;
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void CPickup::CustomEvent(Int32 header, Object & payload) const
|
||||
void CPickup::CustomEvent(Int32 header, LightObj & payload) const
|
||||
{
|
||||
// Validate the managed identifier
|
||||
Validate();
|
||||
@ -413,30 +398,30 @@ void CPickup::SetPositionZ(Float32 z) const
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
static Object & Pickup_CreateEx(Int32 model, Int32 world, Int32 quantity,
|
||||
static LightObj & Pickup_CreateEx(Int32 model, Int32 world, Int32 quantity,
|
||||
Float32 x, Float32 y, Float32 z, Int32 alpha, bool automatic)
|
||||
{
|
||||
return Core::Get().NewPickup(model, world, quantity, x, y, z, alpha, automatic,
|
||||
SQMOD_CREATE_DEFAULT, NullObject());
|
||||
SQMOD_CREATE_DEFAULT, NullLightObj());
|
||||
}
|
||||
|
||||
static Object & Pickup_CreateEx(Int32 model, Int32 world, Int32 quantity,
|
||||
static LightObj & Pickup_CreateEx(Int32 model, Int32 world, Int32 quantity,
|
||||
Float32 x, Float32 y, Float32 z, Int32 alpha, bool automatic,
|
||||
Int32 header, Object & payload)
|
||||
Int32 header, LightObj & payload)
|
||||
{
|
||||
return Core::Get().NewPickup(model, world, quantity, x, y, z, alpha, automatic, header, payload);
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
static Object & Pickup_Create(Int32 model, Int32 world, Int32 quantity, const Vector3 & pos,
|
||||
static LightObj & Pickup_Create(Int32 model, Int32 world, Int32 quantity, const Vector3 & pos,
|
||||
Int32 alpha, bool automatic)
|
||||
{
|
||||
return Core::Get().NewPickup(model, world, quantity, pos.x, pos.y, pos.z, alpha, automatic,
|
||||
SQMOD_CREATE_DEFAULT, NullObject());
|
||||
SQMOD_CREATE_DEFAULT, NullLightObj());
|
||||
}
|
||||
|
||||
static Object & Pickup_Create(Int32 model, Int32 world, Int32 quantity, const Vector3 & pos,
|
||||
Int32 alpha, bool automatic, Int32 header, Object & payload)
|
||||
static LightObj & Pickup_Create(Int32 model, Int32 world, Int32 quantity, const Vector3 & pos,
|
||||
Int32 alpha, bool automatic, Int32 header, LightObj & payload)
|
||||
{
|
||||
return Core::Get().NewPickup(model, world, quantity, pos.x, pos.y, pos.z, alpha, automatic,
|
||||
header, payload);
|
||||
@ -453,18 +438,18 @@ void Register_CPickup(HSQUIRRELVM vm)
|
||||
// Static Values
|
||||
.SetStaticValue(_SC("MaxID"), CPickup::Max)
|
||||
// Core Properties
|
||||
.Prop(_SC("On"), &CPickup::GetEvents)
|
||||
.Prop(_SC("ID"), &CPickup::GetID)
|
||||
.Prop(_SC("Tag"), &CPickup::GetTag, &CPickup::SetTag)
|
||||
.Prop(_SC("Data"), &CPickup::GetData, &CPickup::SetData)
|
||||
.Prop(_SC("Active"), &CPickup::IsActive)
|
||||
// Core Methods
|
||||
.Func(_SC("Bind"), &CPickup::BindEvent)
|
||||
.FmtFunc(_SC("SetTag"), &CPickup::ApplyTag)
|
||||
.Func(_SC("CustomEvent"), &CPickup::CustomEvent)
|
||||
// Core Overloads
|
||||
.Overload< bool (CPickup::*)(void) >(_SC("Destroy"), &CPickup::Destroy)
|
||||
.Overload< bool (CPickup::*)(Int32) >(_SC("Destroy"), &CPickup::Destroy)
|
||||
.Overload< bool (CPickup::*)(Int32, Object &) >(_SC("Destroy"), &CPickup::Destroy)
|
||||
.Overload< bool (CPickup::*)(Int32, LightObj &) >(_SC("Destroy"), &CPickup::Destroy)
|
||||
// Properties
|
||||
.Prop(_SC("Model"), &CPickup::GetModel)
|
||||
.Prop(_SC("World"), &CPickup::GetWorld, &CPickup::SetWorld)
|
||||
@ -485,13 +470,13 @@ void Register_CPickup(HSQUIRRELVM vm)
|
||||
.Func(_SC("SetPos"), &CPickup::SetPositionEx)
|
||||
.Func(_SC("SetPosition"), &CPickup::SetPositionEx)
|
||||
// Static Overloads
|
||||
.StaticOverload< Object & (*)(Int32, Int32, Int32, Float32, Float32, Float32, Int32, bool) >
|
||||
.StaticOverload< LightObj & (*)(Int32, Int32, Int32, Float32, Float32, Float32, Int32, bool) >
|
||||
(_SC("CreateEx"), &Pickup_CreateEx)
|
||||
.StaticOverload< Object & (*)(Int32, Int32, Int32, Float32, Float32, Float32, Int32, bool, Int32, Object &) >
|
||||
.StaticOverload< LightObj & (*)(Int32, Int32, Int32, Float32, Float32, Float32, Int32, bool, Int32, LightObj &) >
|
||||
(_SC("CreateEx"), &Pickup_CreateEx)
|
||||
.StaticOverload< Object & (*)(Int32, Int32, Int32, const Vector3 &, Int32, bool) >
|
||||
.StaticOverload< LightObj & (*)(Int32, Int32, Int32, const Vector3 &, Int32, bool) >
|
||||
(_SC("Create"), &Pickup_Create)
|
||||
.StaticOverload< Object & (*)(Int32, Int32, Int32, const Vector3 &, Int32, bool, Int32, Object &) >
|
||||
.StaticOverload< LightObj & (*)(Int32, Int32, Int32, const Vector3 &, Int32, bool, Int32, LightObj &) >
|
||||
(_SC("Create"), &Pickup_Create)
|
||||
// Raw Squirrel Methods
|
||||
.SquirrelFunc(_SC("NullInst"), &CPickup::SqGetNull)
|
||||
|
@ -34,22 +34,22 @@ private:
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Identifier of the managed entity.
|
||||
*/
|
||||
Int32 m_ID;
|
||||
Int32 m_ID;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* User tag associated with this instance.
|
||||
*/
|
||||
String m_Tag;
|
||||
String m_Tag;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* User data associated with this instance.
|
||||
*/
|
||||
Object m_Data;
|
||||
LightObj m_Data;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Prevent events from triggering themselves.
|
||||
*/
|
||||
Uint32 m_CircularLocks;
|
||||
Uint32 m_CircularLocks;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Base constructor.
|
||||
@ -112,7 +112,7 @@ public:
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Retrieve the associated null entity instance.
|
||||
*/
|
||||
static Object & GetNull();
|
||||
static LightObj & GetNull();
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Retrieve the identifier of the entity managed by this instance.
|
||||
@ -148,19 +148,19 @@ public:
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Retrieve the associated user data.
|
||||
*/
|
||||
Object & GetData();
|
||||
LightObj & GetData();
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Modify the associated user data.
|
||||
*/
|
||||
void SetData(Object & data);
|
||||
void SetData(LightObj & data);
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Destroy the managed pickup entity.
|
||||
*/
|
||||
bool Destroy()
|
||||
{
|
||||
return Destroy(0, NullObject());
|
||||
return Destroy(0, NullLightObj());
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
@ -168,23 +168,23 @@ public:
|
||||
*/
|
||||
bool Destroy(Int32 header)
|
||||
{
|
||||
return Destroy(header, NullObject());
|
||||
return Destroy(header, NullLightObj());
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Destroy the managed pickup entity.
|
||||
*/
|
||||
bool Destroy(Int32 header, Object & payload);
|
||||
bool Destroy(Int32 header, LightObj & payload);
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Bind to an event supported by this entity type.
|
||||
* Retrieve the events table of this entity.
|
||||
*/
|
||||
void BindEvent(Int32 evid, Object & env, Function & func) const;
|
||||
LightObj & GetEvents() const;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Emit a custom event for the managed entity
|
||||
*/
|
||||
void CustomEvent(Int32 header, Object & payload) const;
|
||||
void CustomEvent(Int32 header, LightObj & payload) const;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* See if the managed pickup entity is streamed for the specified player.
|
||||
|
@ -41,7 +41,7 @@ SQInteger CPlayer::SqGetNull(HSQUIRRELVM vm)
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
Object & CPlayer::GetNull()
|
||||
LightObj & CPlayer::GetNull()
|
||||
{
|
||||
return Core::Get().GetNullPlayer();
|
||||
}
|
||||
@ -107,7 +107,7 @@ CPlayer & CPlayer::ApplyTag(const StackStrF & tag)
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
Object & CPlayer::GetData()
|
||||
LightObj & CPlayer::GetData()
|
||||
{
|
||||
// Validate the managed identifier
|
||||
Validate();
|
||||
@ -116,7 +116,7 @@ Object & CPlayer::GetData()
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void CPlayer::SetData(Object & data)
|
||||
void CPlayer::SetData(LightObj & data)
|
||||
{
|
||||
// Validate the managed identifier
|
||||
Validate();
|
||||
@ -125,31 +125,16 @@ void CPlayer::SetData(Object & data)
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void CPlayer::BindEvent(Int32 evid, Object & env, Function & func) const
|
||||
LightObj & CPlayer::GetEvents() const
|
||||
{
|
||||
// Validate the managed identifier
|
||||
Validate();
|
||||
// Obtain the function instance called for this event
|
||||
Function & event = Core::Get().GetPlayerEvent(m_ID, evid);
|
||||
// Is the specified callback function null?
|
||||
if (func.IsNull())
|
||||
{
|
||||
event.ReleaseGently(); // Then release the current callback
|
||||
}
|
||||
// Does this function need a custom environment?
|
||||
else if (env.IsNull())
|
||||
{
|
||||
event = func;
|
||||
}
|
||||
// Assign the specified environment and function
|
||||
else
|
||||
{
|
||||
event = Function(env.GetVM(), env, func.GetFunc());
|
||||
}
|
||||
// Return the associated event table
|
||||
return Core::Get().GetPlayer(m_ID).mEvents;
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void CPlayer::CustomEvent(Int32 header, Object & payload) const
|
||||
void CPlayer::CustomEvent(Int32 header, LightObj & payload) const
|
||||
{
|
||||
// Validate the managed identifier
|
||||
Validate();
|
||||
@ -265,13 +250,13 @@ void CPlayer::Kick() const
|
||||
Validate();
|
||||
// Store the default header and payload
|
||||
Core::Get().GetPlayer(m_ID).mKickBanHeader = vcmpDisconnectReasonKick;
|
||||
Core::Get().GetPlayer(m_ID).mKickBanPayload = NullObject();
|
||||
Core::Get().GetPlayer(m_ID).mKickBanPayload = NullLightObj();
|
||||
// Perform the requested operation
|
||||
_Func->KickPlayer(m_ID);
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void CPlayer::KickBecause(Int32 header, Object & payload) const
|
||||
void CPlayer::KickBecause(Int32 header, LightObj & payload) const
|
||||
{
|
||||
// Validate the managed identifier
|
||||
Validate();
|
||||
@ -289,13 +274,13 @@ void CPlayer::Ban() const
|
||||
Validate();
|
||||
// Store the default header and payload
|
||||
Core::Get().GetPlayer(m_ID).mKickBanHeader = vcmpDisconnectReasonKick;
|
||||
Core::Get().GetPlayer(m_ID).mKickBanPayload = NullObject();
|
||||
Core::Get().GetPlayer(m_ID).mKickBanPayload = NullLightObj();
|
||||
// Perform the requested operation
|
||||
_Func->BanPlayer(m_ID);
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void CPlayer::BanBecause(Int32 header, Object & payload) const
|
||||
void CPlayer::BanBecause(Int32 header, LightObj & payload) const
|
||||
{
|
||||
// Validate the managed identifier
|
||||
Validate();
|
||||
@ -379,11 +364,11 @@ Int32 CPlayer::GetOption(Int32 option_id) const
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void CPlayer::SetOption(Int32 option_id, bool toggle)
|
||||
{
|
||||
SetOptionEx(option_id, toggle, 0, NullObject());
|
||||
SetOptionEx(option_id, toggle, 0, NullLightObj());
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void CPlayer::SetOptionEx(Int32 option_id, bool toggle, Int32 header, Object & payload)
|
||||
void CPlayer::SetOptionEx(Int32 option_id, bool toggle, Int32 header, LightObj & payload)
|
||||
{
|
||||
// Validate the managed identifier
|
||||
Validate();
|
||||
@ -1099,7 +1084,7 @@ Int32 CPlayer::GetVehicleSlot() const
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
Object & CPlayer::GetVehicle() const
|
||||
LightObj & CPlayer::GetVehicle() const
|
||||
{
|
||||
// Validate the managed identifier
|
||||
Validate();
|
||||
@ -1112,7 +1097,7 @@ Object & CPlayer::GetVehicle() const
|
||||
return Core::Get().GetVehicle(id).mObj;
|
||||
}
|
||||
// Default to a null object
|
||||
return NullObject();
|
||||
return NullLightObj();
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
@ -1300,7 +1285,7 @@ void CPlayer::SetAnimation(Int32 anim, Int32 group) const
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
Object & CPlayer::StandingOnVehicle() const
|
||||
LightObj & CPlayer::StandingOnVehicle() const
|
||||
{
|
||||
// Validate the managed identifier
|
||||
Validate();
|
||||
@ -1313,11 +1298,11 @@ Object & CPlayer::StandingOnVehicle() const
|
||||
return Core::Get().GetVehicle(id).mObj;
|
||||
}
|
||||
// Default to a null object
|
||||
return NullObject();
|
||||
return NullLightObj();
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
Object & CPlayer::StandingOnObject() const
|
||||
LightObj & CPlayer::StandingOnObject() const
|
||||
{
|
||||
// Validate the managed identifier
|
||||
Validate();
|
||||
@ -1330,7 +1315,7 @@ Object & CPlayer::StandingOnObject() const
|
||||
return Core::Get().GetObject(id).mObj;
|
||||
}
|
||||
// Default to a null object
|
||||
return NullObject();
|
||||
return NullLightObj();
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
@ -1343,7 +1328,7 @@ bool CPlayer::IsAway() const
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
Object & CPlayer::GetSpectator() const
|
||||
LightObj & CPlayer::GetSpectator() const
|
||||
{
|
||||
// Validate the managed identifier
|
||||
Validate();
|
||||
@ -1356,7 +1341,7 @@ Object & CPlayer::GetSpectator() const
|
||||
return Core::Get().GetPlayer(id).mObj;
|
||||
}
|
||||
// Default to a null object
|
||||
return NullObject();
|
||||
return NullLightObj();
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
@ -1392,20 +1377,20 @@ void CPlayer::PlaySound(Int32 sound_id) const
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
Object & CPlayer::CreateCheckpointEx(Int32 world, bool sphere, Float32 x, Float32 y, Float32 z,
|
||||
LightObj & CPlayer::CreateCheckpointEx(Int32 world, bool sphere, Float32 x, Float32 y, Float32 z,
|
||||
Uint8 r, Uint8 g, Uint8 b, Uint8 a, Float32 radius) const
|
||||
{
|
||||
// Validate the managed identifier
|
||||
Validate();
|
||||
// Perform the requested operation
|
||||
return Core::Get().NewCheckpoint(m_ID, world, sphere, x, y, z, r, g, b, a, radius,
|
||||
SQMOD_CREATE_DEFAULT, NullObject());
|
||||
SQMOD_CREATE_DEFAULT, NullLightObj());
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
Object & CPlayer::CreateCheckpointEx(Int32 world, bool sphere, Float32 x, Float32 y, Float32 z,
|
||||
LightObj & CPlayer::CreateCheckpointEx(Int32 world, bool sphere, Float32 x, Float32 y, Float32 z,
|
||||
Uint8 r, Uint8 g, Uint8 b, Uint8 a, Float32 radius,
|
||||
Int32 header, Object & payload) const
|
||||
Int32 header, LightObj & payload) const
|
||||
{
|
||||
// Validate the managed identifier
|
||||
Validate();
|
||||
@ -1415,7 +1400,7 @@ Object & CPlayer::CreateCheckpointEx(Int32 world, bool sphere, Float32 x, Float3
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
Object & CPlayer::CreateCheckpoint(Int32 world, bool sphere, const Vector3 & pos,
|
||||
LightObj & CPlayer::CreateCheckpoint(Int32 world, bool sphere, const Vector3 & pos,
|
||||
const Color4 & color, Float32 radius) const
|
||||
{
|
||||
// Validate the managed identifier
|
||||
@ -1423,12 +1408,12 @@ Object & CPlayer::CreateCheckpoint(Int32 world, bool sphere, const Vector3 & pos
|
||||
// Perform the requested operation
|
||||
return Core::Get().NewCheckpoint(m_ID, world, sphere, pos.x, pos.y, pos.z,
|
||||
color.r, color.g, color.b, color.a, radius,
|
||||
SQMOD_CREATE_DEFAULT, NullObject());
|
||||
SQMOD_CREATE_DEFAULT, NullLightObj());
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
Object & CPlayer::CreateCheckpoint(Int32 world, bool sphere, const Vector3 & pos, const Color4 & color,
|
||||
Float32 radius, Int32 header, Object & payload) const
|
||||
LightObj & CPlayer::CreateCheckpoint(Int32 world, bool sphere, const Vector3 & pos, const Color4 & color,
|
||||
Float32 radius, Int32 header, LightObj & payload) const
|
||||
{
|
||||
// Validate the managed identifier
|
||||
Validate();
|
||||
@ -1502,7 +1487,7 @@ void CPlayer::SetTrackPosition(SQInteger num) const
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void CPlayer::SetTrackPositionEx(SQInteger num, Int32 header, const Object & payload) const
|
||||
void CPlayer::SetTrackPositionEx(SQInteger num, Int32 header, const LightObj & payload) const
|
||||
{
|
||||
// Validate the managed identifier
|
||||
Validate();
|
||||
@ -2315,7 +2300,7 @@ SQInteger CPlayer::AnnounceEx(HSQUIRRELVM vm)
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
static const Object & Player_FindAuto(Object & by)
|
||||
static const LightObj & Player_FindAuto(Object & by)
|
||||
{
|
||||
switch (by.GetType())
|
||||
{
|
||||
@ -2342,7 +2327,7 @@ static const Object & Player_FindAuto(Object & by)
|
||||
default: STHROWF("Unsupported search identifier");
|
||||
}
|
||||
// Default to a null object
|
||||
return NullObject();
|
||||
return NullLightObj();
|
||||
}
|
||||
|
||||
// ================================================================================================
|
||||
@ -2366,12 +2351,12 @@ void Register_CPlayer(HSQUIRRELVM vm)
|
||||
.Var(_SC("AnnouncePostfix"), &CPlayer::mAnnouncePostfix)
|
||||
.Var(_SC("LimitPrefixPostfixMessage"), &CPlayer::mLimitPrefixPostfixMessage)
|
||||
// Core Properties
|
||||
.Prop(_SC("On"), &CPlayer::GetEvents)
|
||||
.Prop(_SC("ID"), &CPlayer::GetID)
|
||||
.Prop(_SC("Tag"), &CPlayer::GetTag, &CPlayer::SetTag)
|
||||
.Prop(_SC("Data"), &CPlayer::GetData, &CPlayer::SetData)
|
||||
.Prop(_SC("Active"), &CPlayer::IsActive)
|
||||
// Core Methods
|
||||
.Func(_SC("Bind"), &CPlayer::BindEvent)
|
||||
.FmtFunc(_SC("SetTag"), &CPlayer::ApplyTag)
|
||||
.Func(_SC("CustomEvent"), &CPlayer::CustomEvent)
|
||||
// Properties
|
||||
@ -2510,13 +2495,13 @@ void Register_CPlayer(HSQUIRRELVM vm)
|
||||
(_SC("SetAnimation"), &CPlayer::SetAnimation)
|
||||
.Overload< void (CPlayer::*)(Int32, Int32) const >
|
||||
(_SC("SetAnimation"), &CPlayer::SetAnimation)
|
||||
.Overload< Object & (CPlayer::*)(Int32, bool, Float32, Float32, Float32, Uint8, Uint8, Uint8, Uint8, Float32) const >
|
||||
.Overload< LightObj & (CPlayer::*)(Int32, bool, Float32, Float32, Float32, Uint8, Uint8, Uint8, Uint8, Float32) const >
|
||||
(_SC("CreateCheckpointEx"), &CPlayer::CreateCheckpointEx)
|
||||
.Overload< Object & (CPlayer::*)(Int32, bool, Float32, Float32, Float32, Uint8, Uint8, Uint8, Uint8, Float32, Int32, Object &) const >
|
||||
.Overload< LightObj & (CPlayer::*)(Int32, bool, Float32, Float32, Float32, Uint8, Uint8, Uint8, Uint8, Float32, Int32, LightObj &) const >
|
||||
(_SC("CreateCheckpointEx"), &CPlayer::CreateCheckpointEx)
|
||||
.Overload< Object & (CPlayer::*)(Int32, bool, const Vector3 &, const Color4 &, Float32) const >
|
||||
.Overload< LightObj & (CPlayer::*)(Int32, bool, const Vector3 &, const Color4 &, Float32) const >
|
||||
(_SC("CreateCheckpoint"), &CPlayer::CreateCheckpoint)
|
||||
.Overload< Object & (CPlayer::*)(Int32, bool, const Vector3 &, const Color4 &, Float32, Int32, Object &) const >
|
||||
.Overload< LightObj & (CPlayer::*)(Int32, bool, const Vector3 &, const Color4 &, Float32, Int32, LightObj &) const >
|
||||
(_SC("CreateCheckpoint"), &CPlayer::CreateCheckpoint)
|
||||
// Static Functions
|
||||
.StaticFunc(_SC("Find"), &Player_FindAuto)
|
||||
|
@ -45,27 +45,27 @@ private:
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Identifier of the managed entity.
|
||||
*/
|
||||
Int32 m_ID;
|
||||
Int32 m_ID;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* User tag associated with this instance.
|
||||
*/
|
||||
String m_Tag;
|
||||
String m_Tag;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* User data associated with this instance.
|
||||
*/
|
||||
Object m_Data;
|
||||
LightObj m_Data;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Buffer used to generate client data.
|
||||
*/
|
||||
Buffer m_Buffer;
|
||||
Buffer m_Buffer;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Prevent events from triggering themselves.
|
||||
*/
|
||||
Uint32 m_CircularLocks;
|
||||
Uint32 m_CircularLocks;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Base constructor.
|
||||
@ -181,7 +181,7 @@ public:
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Retrieve the associated null entity instance.
|
||||
*/
|
||||
static Object & GetNull();
|
||||
static LightObj & GetNull();
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Retrieve the identifier of the entity managed by this instance.
|
||||
@ -217,22 +217,22 @@ public:
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Retrieve the associated user data.
|
||||
*/
|
||||
Object & GetData();
|
||||
LightObj & GetData();
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Modify the associated user data.
|
||||
*/
|
||||
void SetData(Object & data);
|
||||
void SetData(LightObj & data);
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Bind to an event supported by this entity type.
|
||||
* Retrieve the events table of this entity.
|
||||
*/
|
||||
void BindEvent(Int32 evid, Object & env, Function & func) const;
|
||||
LightObj & GetEvents() const;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Emit a custom event for the managed entity
|
||||
*/
|
||||
void CustomEvent(Int32 header, Object & payload) const;
|
||||
void CustomEvent(Int32 header, LightObj & payload) const;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* See whether the managed player entity is connected.
|
||||
@ -277,7 +277,7 @@ public:
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Kick the managed player entity from the server.
|
||||
*/
|
||||
void KickBecause(Int32 header, Object & payload) const;
|
||||
void KickBecause(Int32 header, LightObj & payload) const;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Ban the managed player entity from the server.
|
||||
@ -287,7 +287,7 @@ public:
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Ban the managed player entity from the server.
|
||||
*/
|
||||
void BanBecause(Int32 header, Object & payload) const;
|
||||
void BanBecause(Int32 header, LightObj & payload) const;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Retrieve the key of the managed player entity.
|
||||
@ -322,7 +322,7 @@ public:
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Modify the current option value of the managed player entity.
|
||||
*/
|
||||
void SetOptionEx(Int32 option_id, bool toggle, Int32 header, Object & payload);
|
||||
void SetOptionEx(Int32 option_id, bool toggle, Int32 header, LightObj & payload);
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Retrieve the world in which the managed player entity exists.
|
||||
@ -612,7 +612,7 @@ public:
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Retrieve the vehicle in which the managed player entity is embarked.
|
||||
*/
|
||||
Object & GetVehicle() const;
|
||||
LightObj & GetVehicle() const;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Retrieve the vehicle identifier in which the managed player entity is embarked.
|
||||
@ -707,12 +707,12 @@ public:
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Retrieve the vehicle that the managed player entity is standing on.
|
||||
*/
|
||||
Object & StandingOnVehicle() const;
|
||||
LightObj & StandingOnVehicle() const;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Retrieve the object that the managed player entity is standing on.
|
||||
*/
|
||||
Object & StandingOnObject() const;
|
||||
LightObj & StandingOnObject() const;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* See whether the managed player entity is away.
|
||||
@ -722,7 +722,7 @@ public:
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Retrieve the player that the managed player entity is spectating.
|
||||
*/
|
||||
Object & GetSpectator() const;
|
||||
LightObj & GetSpectator() const;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Set the managed player entity to spectate the specified player entity.
|
||||
@ -743,27 +743,27 @@ public:
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Create a checkpoint or sphere for this player.
|
||||
*/
|
||||
Object & CreateCheckpointEx(Int32 world, bool sphere, Float32 x, Float32 y, Float32 z,
|
||||
LightObj & CreateCheckpointEx(Int32 world, bool sphere, Float32 x, Float32 y, Float32 z,
|
||||
Uint8 r, Uint8 g, Uint8 b, Uint8 a, Float32 radius) const;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Create a checkpoint or sphere for this player.
|
||||
*/
|
||||
Object & CreateCheckpointEx(Int32 world, bool sphere, Float32 x, Float32 y, Float32 z,
|
||||
LightObj & CreateCheckpointEx(Int32 world, bool sphere, Float32 x, Float32 y, Float32 z,
|
||||
Uint8 r, Uint8 g, Uint8 b, Uint8 a, Float32 radius,
|
||||
Int32 header, Object & payload) const;
|
||||
Int32 header, LightObj & payload) const;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Create a checkpoint or sphere for this player.
|
||||
*/
|
||||
Object & CreateCheckpoint(Int32 world, bool sphere, const Vector3 & pos,
|
||||
LightObj & CreateCheckpoint(Int32 world, bool sphere, const Vector3 & pos,
|
||||
const Color4 & color, Float32 radius) const;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Create a checkpoint or sphere for this player.
|
||||
*/
|
||||
Object & CreateCheckpoint(Int32 world, bool sphere, const Vector3 & pos, const Color4 & color,
|
||||
Float32 radius, Int32 header, Object & payload) const;
|
||||
LightObj & CreateCheckpoint(Int32 world, bool sphere, const Vector3 & pos, const Color4 & color,
|
||||
Float32 radius, Int32 header, LightObj & payload) const;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Retrieve the authority level of the managed player entity.
|
||||
@ -798,7 +798,7 @@ public:
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Modify the amount of tracked position changes for the managed player entity.
|
||||
*/
|
||||
void SetTrackPositionEx(SQInteger num, Int32 header, const Object & payload) const;
|
||||
void SetTrackPositionEx(SQInteger num, Int32 header, const LightObj & payload) const;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Retrieve the amount of tracked heading changes for the managed player entity.
|
||||
|
@ -29,7 +29,7 @@ SQInteger CVehicle::SqGetNull(HSQUIRRELVM vm)
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
Object & CVehicle::GetNull()
|
||||
LightObj & CVehicle::GetNull()
|
||||
{
|
||||
return Core::Get().GetNullVehicle();
|
||||
}
|
||||
@ -81,7 +81,7 @@ CVehicle & CVehicle::ApplyTag(const StackStrF & tag)
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
Object & CVehicle::GetData()
|
||||
LightObj & CVehicle::GetData()
|
||||
{
|
||||
// Validate the managed identifier
|
||||
Validate();
|
||||
@ -90,7 +90,7 @@ Object & CVehicle::GetData()
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void CVehicle::SetData(Object & data)
|
||||
void CVehicle::SetData(LightObj & data)
|
||||
{
|
||||
// Validate the managed identifier
|
||||
Validate();
|
||||
@ -99,7 +99,7 @@ void CVehicle::SetData(Object & data)
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
bool CVehicle::Destroy(Int32 header, Object & payload)
|
||||
bool CVehicle::Destroy(Int32 header, LightObj & payload)
|
||||
{
|
||||
// Validate the managed identifier
|
||||
Validate();
|
||||
@ -108,31 +108,16 @@ bool CVehicle::Destroy(Int32 header, Object & payload)
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void CVehicle::BindEvent(Int32 evid, Object & env, Function & func) const
|
||||
LightObj & CVehicle::GetEvents() const
|
||||
{
|
||||
// Validate the managed identifier
|
||||
Validate();
|
||||
// Obtain the function instance called for this event
|
||||
Function & event = Core::Get().GetVehicleEvent(m_ID, evid);
|
||||
// Is the specified callback function null?
|
||||
if (func.IsNull())
|
||||
{
|
||||
event.ReleaseGently(); // Then release the current callback
|
||||
}
|
||||
// Does this function need a custom environment?
|
||||
else if (env.IsNull())
|
||||
{
|
||||
event = func;
|
||||
}
|
||||
// Assign the specified environment and function
|
||||
else
|
||||
{
|
||||
event = Function(env.GetVM(), env, func.GetFunc());
|
||||
}
|
||||
// Return the associated event table
|
||||
return Core::Get().GetVehicle(m_ID).mEvents;
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void CVehicle::CustomEvent(Int32 header, Object & payload) const
|
||||
void CVehicle::CustomEvent(Int32 header, LightObj & payload) const
|
||||
{
|
||||
// Validate the managed identifier
|
||||
Validate();
|
||||
@ -184,12 +169,12 @@ void CVehicle::SetOption(Int32 option_id, bool toggle)
|
||||
// Prevent this event from triggering while executed
|
||||
BitGuardU32 bg(m_CircularLocks, VEHICLECL_EMIT_VEHICLE_OPTION);
|
||||
// Now forward the event call
|
||||
Core::Get().EmitVehicleOption(m_ID, option_id, value, 0, NullObject());
|
||||
Core::Get().EmitVehicleOption(m_ID, option_id, value, 0, NullLightObj());
|
||||
}
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
void CVehicle::SetOptionEx(Int32 option_id, bool toggle, Int32 header, Object & payload)
|
||||
void CVehicle::SetOptionEx(Int32 option_id, bool toggle, Int32 header, LightObj & payload)
|
||||
{
|
||||
// Attempt to obtain the current value of the specified option
|
||||
const bool value = _Func->GetVehicleOption(m_ID, static_cast< vcmpVehicleOption >(option_id));
|
||||
@ -269,7 +254,7 @@ Int32 CVehicle::GetModel() const
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
Object & CVehicle::GetOccupant(Int32 slot) const
|
||||
LightObj & CVehicle::GetOccupant(Int32 slot) const
|
||||
{
|
||||
// Validate the managed identifier
|
||||
Validate();
|
||||
@ -1725,30 +1710,30 @@ void CVehicle::SetRelativeTurnSpeedZ(Float32 z) const
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
static Object & Vehicle_CreateEx(Int32 model, Int32 world, Float32 x, Float32 y, Float32 z, Float32 angle,
|
||||
static LightObj & Vehicle_CreateEx(Int32 model, Int32 world, Float32 x, Float32 y, Float32 z, Float32 angle,
|
||||
Int32 primary, Int32 secondary)
|
||||
{
|
||||
return Core::Get().NewVehicle(model, world, x, y, z, angle, primary, secondary,
|
||||
SQMOD_CREATE_DEFAULT, NullObject());
|
||||
SQMOD_CREATE_DEFAULT, NullLightObj());
|
||||
}
|
||||
|
||||
static Object & Vehicle_CreateEx(Int32 model, Int32 world, Float32 x, Float32 y, Float32 z, Float32 angle,
|
||||
Int32 primary, Int32 secondary, Int32 header, Object & payload)
|
||||
static LightObj & Vehicle_CreateEx(Int32 model, Int32 world, Float32 x, Float32 y, Float32 z, Float32 angle,
|
||||
Int32 primary, Int32 secondary, Int32 header, LightObj & payload)
|
||||
{
|
||||
return Core::Get().NewVehicle(model, world, x, y, z, angle, primary, secondary,
|
||||
header, payload);
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
static Object & Vehicle_Create(Int32 model, Int32 world, const Vector3 & pos, Float32 angle,
|
||||
static LightObj & Vehicle_Create(Int32 model, Int32 world, const Vector3 & pos, Float32 angle,
|
||||
Int32 primary, Int32 secondary)
|
||||
{
|
||||
return Core::Get().NewVehicle(model, world, pos.x, pos.y, pos.z, angle, primary, secondary,
|
||||
SQMOD_CREATE_DEFAULT, NullObject());
|
||||
SQMOD_CREATE_DEFAULT, NullLightObj());
|
||||
}
|
||||
|
||||
static Object & Vehicle_Create(Int32 model, Int32 world, const Vector3 & pos, Float32 angle,
|
||||
Int32 primary, Int32 secondary, Int32 header, Object & payload)
|
||||
static LightObj & Vehicle_Create(Int32 model, Int32 world, const Vector3 & pos, Float32 angle,
|
||||
Int32 primary, Int32 secondary, Int32 header, LightObj & payload)
|
||||
{
|
||||
return Core::Get().NewVehicle(model, world, pos.x, pos.y, pos.z, angle, primary, secondary,
|
||||
header, payload);
|
||||
@ -1765,18 +1750,18 @@ void Register_CVehicle(HSQUIRRELVM vm)
|
||||
// Static Values
|
||||
.SetStaticValue(_SC("MaxID"), CVehicle::Max)
|
||||
// Core Properties
|
||||
.Prop(_SC("On"), &CVehicle::GetEvents)
|
||||
.Prop(_SC("ID"), &CVehicle::GetID)
|
||||
.Prop(_SC("Tag"), &CVehicle::GetTag, &CVehicle::SetTag)
|
||||
.Prop(_SC("Data"), &CVehicle::GetData, &CVehicle::SetData)
|
||||
.Prop(_SC("Active"), &CVehicle::IsActive)
|
||||
// Core Methods
|
||||
.Func(_SC("Bind"), &CVehicle::BindEvent)
|
||||
.FmtFunc(_SC("SetTag"), &CVehicle::ApplyTag)
|
||||
.Func(_SC("CustomEvent"), &CVehicle::CustomEvent)
|
||||
// Core Overloads
|
||||
.Overload< bool (CVehicle::*)(void) >(_SC("Destroy"), &CVehicle::Destroy)
|
||||
.Overload< bool (CVehicle::*)(Int32) >(_SC("Destroy"), &CVehicle::Destroy)
|
||||
.Overload< bool (CVehicle::*)(Int32, Object &) >(_SC("Destroy"), &CVehicle::Destroy)
|
||||
.Overload< bool (CVehicle::*)(Int32, LightObj &) >(_SC("Destroy"), &CVehicle::Destroy)
|
||||
// Properties
|
||||
.Prop(_SC("SyncSource"), &CVehicle::GetSyncSource)
|
||||
.Prop(_SC("SyncType"), &CVehicle::GetSyncType)
|
||||
@ -1918,13 +1903,13 @@ void Register_CVehicle(HSQUIRRELVM vm)
|
||||
.Overload< bool (CVehicle::*)(CPlayer &, Int32, bool, bool) const >
|
||||
(_SC("Embark"), &CVehicle::Embark)
|
||||
// Static Overloads
|
||||
.StaticOverload< Object & (*)(Int32, Int32, Float32, Float32, Float32, Float32, Int32, Int32) >
|
||||
.StaticOverload< LightObj & (*)(Int32, Int32, Float32, Float32, Float32, Float32, Int32, Int32) >
|
||||
(_SC("CreateEx"), &Vehicle_CreateEx)
|
||||
.StaticOverload< Object & (*)(Int32, Int32, Float32, Float32, Float32, Float32, Int32, Int32, Int32, Object &) >
|
||||
.StaticOverload< LightObj & (*)(Int32, Int32, Float32, Float32, Float32, Float32, Int32, Int32, Int32, LightObj &) >
|
||||
(_SC("CreateEx"), &Vehicle_CreateEx)
|
||||
.StaticOverload< Object & (*)(Int32, Int32, const Vector3 &, Float32, Int32, Int32) >
|
||||
.StaticOverload< LightObj & (*)(Int32, Int32, const Vector3 &, Float32, Int32, Int32) >
|
||||
(_SC("Create"), &Vehicle_Create)
|
||||
.StaticOverload< Object & (*)(Int32, Int32, const Vector3 &, Float32, Int32, Int32, Int32, Object &) >
|
||||
.StaticOverload< LightObj & (*)(Int32, Int32, const Vector3 &, Float32, Int32, Int32, Int32, LightObj &) >
|
||||
(_SC("Create"), &Vehicle_Create)
|
||||
// Raw Squirrel Methods
|
||||
.SquirrelFunc(_SC("NullInst"), &CVehicle::SqGetNull)
|
||||
|
@ -40,22 +40,22 @@ private:
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Identifier of the managed entity.
|
||||
*/
|
||||
Int32 m_ID;
|
||||
Int32 m_ID;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* User tag associated with this instance.
|
||||
*/
|
||||
String m_Tag;
|
||||
String m_Tag;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* User data associated with this instance.
|
||||
*/
|
||||
Object m_Data;
|
||||
LightObj m_Data;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Prevent events from triggering themselves.
|
||||
*/
|
||||
Uint32 m_CircularLocks;
|
||||
Uint32 m_CircularLocks;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Base constructor.
|
||||
@ -118,7 +118,7 @@ public:
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Retrieve the associated null entity instance.
|
||||
*/
|
||||
static Object & GetNull();
|
||||
static LightObj & GetNull();
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Retrieve the identifier of the entity managed by this instance.
|
||||
@ -154,19 +154,19 @@ public:
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Retrieve the associated user data.
|
||||
*/
|
||||
Object & GetData();
|
||||
LightObj & GetData();
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Modify the associated user data.
|
||||
*/
|
||||
void SetData(Object & data);
|
||||
void SetData(LightObj & data);
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Destroy the managed vehicle entity.
|
||||
*/
|
||||
bool Destroy()
|
||||
{
|
||||
return Destroy(0, NullObject());
|
||||
return Destroy(0, NullLightObj());
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
@ -174,23 +174,23 @@ public:
|
||||
*/
|
||||
bool Destroy(Int32 header)
|
||||
{
|
||||
return Destroy(header, NullObject());
|
||||
return Destroy(header, NullLightObj());
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Destroy the managed vehicle entity.
|
||||
*/
|
||||
bool Destroy(Int32 header, Object & payload);
|
||||
bool Destroy(Int32 header, LightObj & payload);
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Bind to an event supported by this entity type.
|
||||
* Retrieve the events table of this entity.
|
||||
*/
|
||||
void BindEvent(Int32 evid, Object & env, Function & func) const;
|
||||
LightObj & GetEvents() const;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Emit a custom event for the managed entity
|
||||
*/
|
||||
void CustomEvent(Int32 header, Object & payload) const;
|
||||
void CustomEvent(Int32 header, LightObj & payload) const;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* See if the managed vehicle entity is streamed for the specified player.
|
||||
@ -210,7 +210,7 @@ public:
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Modify the current option value of the managed vehicle entity.
|
||||
*/
|
||||
void SetOptionEx(Int32 option_id, bool toggle, Int32 header, Object & payload);
|
||||
void SetOptionEx(Int32 option_id, bool toggle, Int32 header, LightObj & payload);
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Retrieve the synchronization source of the managed vehicle entity.
|
||||
@ -240,7 +240,7 @@ public:
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Retrieve the slot occupant from the managed vehicle entity.
|
||||
*/
|
||||
Object & GetOccupant(Int32 slot) const;
|
||||
LightObj & GetOccupant(Int32 slot) const;
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Retrieve the slot occupant identifier from the managed vehicle entity.
|
||||
|
Reference in New Issue
Block a user