added command line, added basic character
This commit is contained in:
54
engine/sv_playerstart.cpp
Normal file
54
engine/sv_playerstart.cpp
Normal file
@@ -0,0 +1,54 @@
|
||||
#include "baseentity.h"
|
||||
#include "baseplayer.h"
|
||||
#include "engine.h"
|
||||
#include "tier1/utlvector.h"
|
||||
|
||||
|
||||
CUtlVector<CPlayerStart*> g_PlayerStarts;
|
||||
|
||||
void CPlayerStart::Precache()
|
||||
{
|
||||
}
|
||||
|
||||
void CPlayerStart::Spawn()
|
||||
{
|
||||
g_PlayerStarts.AppendTail(this);
|
||||
};
|
||||
|
||||
void CPlayerStart::ReadParameter( const char *szName, const char *szValue )
|
||||
{
|
||||
CBaseEntity::ReadParameter(szName, szValue);
|
||||
}
|
||||
|
||||
void CPlayerStart::Destroy()
|
||||
{
|
||||
}
|
||||
|
||||
void CPlayerStart::Think( float fDelta )
|
||||
{
|
||||
}
|
||||
|
||||
void CPlayerStart::RoundEnd( void )
|
||||
{
|
||||
m_bIsRunning = false;
|
||||
}
|
||||
|
||||
void CPlayerStart::RoundStart(IIClient *pClient)
|
||||
{
|
||||
IIEngine::DestroyEntity(pOwningPlayer);
|
||||
if (!pClient)
|
||||
return;
|
||||
m_bIsRunning = true;
|
||||
pOwningPlayer = (CBasePlayer*)IIEngine::SpawnEntity("player");
|
||||
if (pOwningPlayer)
|
||||
{
|
||||
pOwningPlayer->pOwningSpawn = this;
|
||||
pOwningPlayer->SetPosition(m_position);
|
||||
}
|
||||
else
|
||||
V_printf("Failed to spawn player\n");
|
||||
IIEngine::InitEntity(pOwningPlayer);
|
||||
pClient->pBasePlayer = pOwningPlayer;
|
||||
};
|
||||
|
||||
DECLARE_ENTITY(info_player_start, CPlayerStart);
|
||||
Reference in New Issue
Block a user