38 lines
739 B
C++
38 lines
739 B
C++
#include "basemodelentity.h"
|
|
#include "game.h"
|
|
|
|
void CBaseModelEntity::Spawn()
|
|
{
|
|
SetThink(Think);
|
|
}
|
|
|
|
void CBaseModelEntity::SetModel( const char *szName )
|
|
{
|
|
V_memset(m_szModel, 0, 256);
|
|
V_strncpy(m_szModel, szName, 255);
|
|
}
|
|
|
|
void CBaseModelEntity::OnModelChanged( const char *szName )
|
|
{
|
|
|
|
}
|
|
|
|
void CBaseModelEntity::Think( float fDelta )
|
|
{
|
|
if (V_strncmp(m_szModel, m_szCurrentModel, 256))
|
|
{
|
|
V_memset(m_szCurrentModel, 0, 256);
|
|
V_strncpy(m_szCurrentModel, m_szModel, 255);
|
|
OnModelChanged(m_szCurrentModel);
|
|
}
|
|
}
|
|
|
|
IMPLEMENT_SEND_DT(CBaseModelEntity)
|
|
NetPropString(m_szModel)
|
|
END_RECV_DT()
|
|
IMPLEMENT_EMPTY_RECV_DT(CBaseModelEntity)
|
|
|
|
BEGIN_DATADESC(CBaseModelEntity)
|
|
DEFINE_KEYFIELD(m_szModel, FIELD_STRING, "model")
|
|
END_DATADESC()
|