mirror of
https://github.com/YGGverse/hlsdk-portable.git
synced 2025-01-23 21:24:27 +00:00
Fix motion_thread save-restore (#351)
This commit is contained in:
parent
92918eace7
commit
882c9f6ec8
@ -4568,6 +4568,7 @@ void CTriggerMotion::Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYP
|
|||||||
class CMotionThread : public CPointEntity
|
class CMotionThread : public CPointEntity
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
void Spawn();
|
||||||
void Think( void );
|
void Think( void );
|
||||||
|
|
||||||
virtual int Save( CSave &save );
|
virtual int Save( CSave &save );
|
||||||
@ -4581,7 +4582,7 @@ public:
|
|||||||
EHANDLE m_hLocus;
|
EHANDLE m_hLocus;
|
||||||
EHANDLE m_hTarget;
|
EHANDLE m_hTarget;
|
||||||
};
|
};
|
||||||
LINK_ENTITY_TO_CLASS( motion_thread, CPointEntity );
|
LINK_ENTITY_TO_CLASS( motion_thread, CMotionThread );
|
||||||
|
|
||||||
TYPEDESCRIPTION CMotionThread::m_SaveData[] =
|
TYPEDESCRIPTION CMotionThread::m_SaveData[] =
|
||||||
{
|
{
|
||||||
@ -4595,6 +4596,11 @@ TYPEDESCRIPTION CMotionThread::m_SaveData[] =
|
|||||||
|
|
||||||
IMPLEMENT_SAVERESTORE(CMotionThread,CPointEntity);
|
IMPLEMENT_SAVERESTORE(CMotionThread,CPointEntity);
|
||||||
|
|
||||||
|
void CMotionThread::Spawn() //AJH
|
||||||
|
{
|
||||||
|
pev->classname = MAKE_STRING("motion_thread"); //We need this for save/restore to work
|
||||||
|
}
|
||||||
|
|
||||||
void CMotionThread::Think( void )
|
void CMotionThread::Think( void )
|
||||||
{
|
{
|
||||||
if( m_hLocus == 0 || m_hTarget == 0 )
|
if( m_hLocus == 0 || m_hTarget == 0 )
|
||||||
@ -4803,6 +4809,7 @@ void CMotionManager::Affect( CBaseEntity *pTarget, CBaseEntity *pActivator )
|
|||||||
|
|
||||||
CMotionThread *pThread = GetClassPtr( (CMotionThread*)NULL );
|
CMotionThread *pThread = GetClassPtr( (CMotionThread*)NULL );
|
||||||
if (pThread == NULL) return; //error?
|
if (pThread == NULL) return; //error?
|
||||||
|
pThread->Spawn();
|
||||||
pThread->m_hLocus = pActivator;
|
pThread->m_hLocus = pActivator;
|
||||||
pThread->m_hTarget = pTarget;
|
pThread->m_hTarget = pTarget;
|
||||||
pThread->m_iszPosition = m_iszPosition;
|
pThread->m_iszPosition = m_iszPosition;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user