Fix some crashes

This commit is contained in:
mittorn 2017-01-08 22:01:01 +00:00
parent c7dd6ee04b
commit 4bafbcdd07
4 changed files with 13 additions and 4 deletions

View File

@ -317,6 +317,7 @@ public:
CCSBot(); // constructor initializes all values to zero
public:
virtual int ObjectCaps( void ) { return CBaseMonster :: ObjectCaps() | FCAP_DONT_SAVE; }
virtual int TakeDamage(entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int bitsDamageType); // invoked when injured by something (EXTEND) - returns the amount of damage inflicted
virtual void Killed(entvars_t *pevAttacker, int iGib); // invoked when killed (EXTEND)
virtual void RoundRespawn();

View File

@ -1618,12 +1618,12 @@ bool BotChatterInterface::ShouldSpeak() const
float BotChatterInterface::GetRadioSilenceDuration()
{
return m_radioSilenceInterval[ m_me->m_iTeam - 1 ].GetElapsedTime();
return 0;// m_radioSilenceInterval[ m_me->m_iTeam - 1 ].GetElapsedTime();
}
void BotChatterInterface::ResetRadioSilenceDuration()
{
m_radioSilenceInterval[m_me->m_iTeam - 1].Reset();
// m_radioSilenceInterval[0].Reset();
}
inline void SayWhere(BotStatement *say, Place place)

View File

@ -156,9 +156,15 @@ void CCSBot::StartLearnProcess()
if (!GetGroundHeight(&pos, &pos.z, &normal))
{
g_pGameRules->GetPlayerSpawnSpot( this );
//pev->origin.z += 30;
pos = pev->origin;
SnapToGrid(&pos.x);
SnapToGrid(&pos.y);
GetGroundHeight(&pos, &pos.z, &normal);
CONSOLE_ECHO("ERROR: Start position invalid\n\n");
m_processMode = PROCESS_NORMAL;
return;
//m_processMode = PROCESS_NORMAL;
//return;
}
m_currentNode = new CNavNode(&pos, &normal);

View File

@ -782,6 +782,8 @@ void CHalfLifeMultiplay::PlayerSpawn( CBasePlayer *pPlayer )
{
BOOL addDefault;
CBaseEntity *pWeaponEntity = NULL;
if( pPlayer->IsBot() )
pPlayer->m_state = STATE_SPAWNED;
if( pPlayer->m_state == STATE_UNINITIALIZED )
{