--
[ Picked text/plain from multipart/alternative ]
Alright, here's the class definition from the .h:
#include "si_BaseSIEntity.h"

class CInfoPlayerSI:public CSIBaseEntity
{
public:
    DECLARE_CLASS( CInfoPlayerSI, CSIBaseEntity );
    DECLARE_DATADESC();

    //CInfoPlayerSI();
    //~CInfoPlayerSI();

    int ShouldTransmit( const CCheckTransmitInfo *pInfo )
    {
        return FL_EDICT_DONTSEND;
    }

    void ChangeTeam(int iTeam);
    void Spawn();

    bool canSpawnPlayer();
private:
    void registerToTeam();
    COutputEvent m_OnSpawn;
    string_t m_strSpawnLocationName;
    int m_iSpawnEffect;
};

The CSIBaseEntity is just derived from CBaseEntity.  And here's the relevant 
stuff from the .cpp:

#include "cbase.h"
//#include "si_BaseSIEntity.h"
#include "si_team.h"
#include "si_info_player_si.h"

BEGIN_DATADESC( CInfoPlayerSI )
DEFINE_KEYFIELD( m_strSpawnLocationName, FIELD_STRING, "SpawnLocName" ),
DEFINE_KEYFIELD( m_iSpawnEffect, FIELD_INTEGER, "SpawnEffect" ),
DEFINE_OUTPUT( m_OnSpawn, "OnSpawn" ),
END_DATADESC()

LINK_ENTITY_TO_CLASS( info_player_si, CInfoPlayerSI );

/*CInfoPlayerSI::CInfoPlayerSI()
{
    AddEFlags(EFL_SERVER_ONLY);
    DevMsg( "Constructing an info_player_si\n" );
}

CInfoPlayerSI::~CInfoPlayerSI()
{
}*/

void CInfoPlayerSI::ChangeTeam(int iTeam)
{
    if(iTeam!=GetTeamNumber()&& GetTeamNumber()!=TEAM_UNASSIGNED)
    {
        CSITeam *pTeam = dynamic_cast<CSITeam 
*>(GetGlobalTeam(GetTeamNumber()));
        pTeam->unRegisterSpawnPoint(this);
    }
    BaseClass::ChangeTeam(iTeam);
    registerToTeam();
}

void CInfoPlayerSI::Spawn()
{
    BaseClass::Spawn();
    AddEFlags(EFL_SERVER_ONLY);
    DevMsg( "Spawning an info_player_si to team %i\n", GetTeamNumber() );
    registerToTeam();
    m_OnSpawn.FireOutput( this, this );
    //Do something with spawneffect and spawnlocname?
}

void CInfoPlayerSI::registerToTeam()
{
    if(GetTeamNumber()!=TEAM_UNASSIGNED)
    {
        DevMsg( "This spawnpoint belongs to team %i\n", GetTeamNumber () );
        CSITeam *pTeam = dynamic_cast<CSITeam 
*>(GetGlobalTeam(GetTeamNumber()));
        pTeam->registerSpawnPoint(this);
    }
}

bool CInfoPlayerSI::canSpawnPlayer()
{
    if(!isEnabled())
        return false;
    //Bert - TODO check player/object blocking!
    return true;
}

I've pretty much been trying every little thing I can think of without any 
success.

Garrett


----- Original Message ----
From: Nick <[EMAIL PROTECTED]>
To: hlcoders@list.valvesoftware.com
Sent: Thursday, July 26, 2007 3:11:34 AM
Subject: Re: [hlcoders] Map entity not spawning

if you could post code that would help









____________________________________________________________________________________
Get the Yahoo! toolbar and be alerted to new email wherever you're surfing.
http://new.toolbar.yahoo.com/toolbar/features/mail/index.php
--

_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives, please 
visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders

Reply via email to