Browse Source

Fix some crashes

hlzbot-dirty
mittorn 8 years ago
parent
commit
4bafbcdd07
  1. 1
      dlls/bot/cs_bot.h
  2. 4
      dlls/bot/cs_bot_chatter.cpp
  3. 10
      dlls/bot/cs_bot_learn.cpp
  4. 2
      dlls/multiplay_gamerules.cpp

1
dlls/bot/cs_bot.h

@ -317,6 +317,7 @@ public:
CCSBot(); // constructor initializes all values to zero CCSBot(); // constructor initializes all values to zero
public: 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 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 Killed(entvars_t *pevAttacker, int iGib); // invoked when killed (EXTEND)
virtual void RoundRespawn(); virtual void RoundRespawn();

4
dlls/bot/cs_bot_chatter.cpp

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

10
dlls/bot/cs_bot_learn.cpp

@ -156,9 +156,15 @@ void CCSBot::StartLearnProcess()
if (!GetGroundHeight(&pos, &pos.z, &normal)) 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"); CONSOLE_ECHO("ERROR: Start position invalid\n\n");
m_processMode = PROCESS_NORMAL; //m_processMode = PROCESS_NORMAL;
return; //return;
} }
m_currentNode = new CNavNode(&pos, &normal); m_currentNode = new CNavNode(&pos, &normal);

2
dlls/multiplay_gamerules.cpp

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

Loading…
Cancel
Save