mirror of
https://github.com/celisej567/source-sdk-2013.git
synced 2026-09-23 20:09:45 +03:00
Added a few more VScript base entity functions to the client
This commit is contained in:
@@ -2621,6 +2621,58 @@ bool CBaseEntity::IsToolRecording() const
|
||||
#endif
|
||||
|
||||
#ifdef MAPBASE_VSCRIPT
|
||||
HSCRIPT CBaseEntity::GetOrCreatePrivateScriptScope()
|
||||
{
|
||||
ValidateScriptScope();
|
||||
return m_ScriptScope;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------------
|
||||
void CBaseEntity::ScriptSetParent(HSCRIPT hParent, const char *szAttachment)
|
||||
{
|
||||
CBaseEntity *pParent = ToEnt(hParent);
|
||||
if ( !pParent )
|
||||
{
|
||||
SetParent(NULL);
|
||||
return;
|
||||
}
|
||||
|
||||
// if an attachment is specified, the parent needs to be CBaseAnimating
|
||||
if ( szAttachment && szAttachment[0] != '\0' )
|
||||
{
|
||||
CBaseAnimating *pAnimating = pParent->GetBaseAnimating();
|
||||
if ( !pAnimating )
|
||||
{
|
||||
Warning("ERROR: Tried to set parent for entity %s (%s), but its parent has no model.\n", GetClassname(), GetDebugName());
|
||||
return;
|
||||
}
|
||||
|
||||
int iAttachment = pAnimating->LookupAttachment(szAttachment);
|
||||
if ( iAttachment <= 0 )
|
||||
{
|
||||
Warning("ERROR: Tried to set parent for entity %s (%s), but it has no attachment named %s.\n", GetClassname(), GetDebugName(), szAttachment);
|
||||
return;
|
||||
}
|
||||
|
||||
SetParent(pParent, iAttachment);
|
||||
SetMoveType(MOVETYPE_NONE);
|
||||
return;
|
||||
}
|
||||
|
||||
SetParent(pParent);
|
||||
}
|
||||
|
||||
HSCRIPT CBaseEntity::GetScriptOwnerEntity()
|
||||
{
|
||||
return ToHScript(GetOwnerEntity());
|
||||
}
|
||||
|
||||
void CBaseEntity::SetScriptOwnerEntity(HSCRIPT pOwner)
|
||||
{
|
||||
SetOwnerEntity(ToEnt(pOwner));
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------------
|
||||
const Vector& CBaseEntity::ScriptGetColorVector()
|
||||
|
||||
Reference in New Issue
Block a user