mirror of
https://github.com/VCMP-SqMod/SqMod.git
synced 2024-11-08 08:47:17 +01:00
Adjust the Vehicle entity methods to use the new method of receiving formatted strings.
This commit is contained in:
parent
6373c24bae
commit
cb8b595318
@ -60,9 +60,23 @@ const String & CVehicle::GetTag() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
void CVehicle::SetTag(CSStr tag)
|
void CVehicle::SetTag(const StackStrF & tag)
|
||||||
{
|
{
|
||||||
m_Tag.assign(tag);
|
if (tag.mLen > 0)
|
||||||
|
{
|
||||||
|
m_Tag.assign(tag.mPtr, tag.mLen);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
m_Tag.clear();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// ------------------------------------------------------------------------------------------------
|
||||||
|
CVehicle & CVehicle::ApplyTag(StackStrF & tag)
|
||||||
|
{
|
||||||
|
SetTag(tag);
|
||||||
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
@ -1756,6 +1770,7 @@ void Register_CVehicle(HSQUIRRELVM vm)
|
|||||||
.Prop(_SC("Active"), &CVehicle::IsActive)
|
.Prop(_SC("Active"), &CVehicle::IsActive)
|
||||||
// Core Methods
|
// Core Methods
|
||||||
.Func(_SC("Bind"), &CVehicle::BindEvent)
|
.Func(_SC("Bind"), &CVehicle::BindEvent)
|
||||||
|
.FmtFunc(_SC("SetTag"), &CVehicle::ApplyTag)
|
||||||
.Func(_SC("CustomEvent"), &CVehicle::CustomEvent)
|
.Func(_SC("CustomEvent"), &CVehicle::CustomEvent)
|
||||||
// Core Overloads
|
// Core Overloads
|
||||||
.Overload< bool (CVehicle::*)(void) >(_SC("Destroy"), &CVehicle::Destroy)
|
.Overload< bool (CVehicle::*)(void) >(_SC("Destroy"), &CVehicle::Destroy)
|
||||||
|
@ -144,7 +144,12 @@ public:
|
|||||||
/* --------------------------------------------------------------------------------------------
|
/* --------------------------------------------------------------------------------------------
|
||||||
* Modify the associated user tag.
|
* Modify the associated user tag.
|
||||||
*/
|
*/
|
||||||
void SetTag(CSStr tag);
|
void SetTag(const StackStrF & tag);
|
||||||
|
|
||||||
|
/* --------------------------------------------------------------------------------------------
|
||||||
|
* Modify the associated user tag.
|
||||||
|
*/
|
||||||
|
CVehicle & ApplyTag(StackStrF & tag);
|
||||||
|
|
||||||
/* --------------------------------------------------------------------------------------------
|
/* --------------------------------------------------------------------------------------------
|
||||||
* Retrieve the associated user data.
|
* Retrieve the associated user data.
|
||||||
|
Loading…
Reference in New Issue
Block a user