work on world

This commit is contained in:
2026-03-16 15:35:31 +02:00
parent c05bca6d27
commit 6d5141cf43
33 changed files with 416 additions and 100 deletions

View File

@@ -1,6 +1,37 @@
#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()