Browse Source

Disable some cs code

hlzbot-dirty
mittorn 8 years ago
parent
commit
857c080545
  1. 15
      dlls/bot/cs_bot.cpp
  2. 53
      dlls/bot/cs_bot.h
  3. 22
      dlls/bot/cs_bot_chatter.cpp
  4. 14
      dlls/bot/cs_bot_chatter.h
  5. 4
      dlls/bot/cs_bot_init.cpp
  6. 17
      dlls/bot/cs_bot_statemachine.cpp
  7. 10
      dlls/bot/cs_bot_update.cpp
  8. 9
      dlls/bot/cs_bot_weapon.cpp
  9. 3
      dlls/bot/states/cs_bot_attack.cpp
  10. 4
      dlls/bot/states/cs_bot_follow.cpp
  11. 5
      dlls/bot/states/cs_bot_hide.cpp
  12. 3
      dlls/bot/states/cs_bot_idle.cpp
  13. 5
      dlls/bot/states/cs_bot_move_to.cpp

15
dlls/bot/cs_bot.cpp

@ -221,10 +221,11 @@ void CCSBot::BotTouch(CBaseEntity *other)
// TODO: Need to account for reaction time, etc. // TODO: Need to account for reaction time, etc.
if (other->IsPlayer()) if (other->IsPlayer())
{ {
#if 0
// if we are defusing a bomb, don't move // if we are defusing a bomb, don't move
if (IsDefusingBomb()) if (IsDefusingBomb())
return; return;
#endif
CBasePlayer *player = static_cast<CBasePlayer *>(other); CBasePlayer *player = static_cast<CBasePlayer *>(other);
// get priority of other player // get priority of other player
@ -292,10 +293,12 @@ void CCSBot::BotTouch(CBaseEntity *other)
bool CCSBot::IsBusy() const bool CCSBot::IsBusy() const
{ {
if (IsAttacking() || if (IsAttacking() ||
#if 0
IsBuying() || IsBuying() ||
IsDefusingBomb() || IsDefusingBomb() ||
GetTask() == PLANT_BOMB || GetTask() == PLANT_BOMB ||
GetTask() == RESCUE_HOSTAGES || GetTask() == RESCUE_HOSTAGES ||
#endif
IsSniping()) IsSniping())
{ {
return true; return true;
@ -462,6 +465,7 @@ bool CCSBot::IsDoingScenario() const
// Return true if we noticed the bomb on the ground or on the radar (for T's only) // Return true if we noticed the bomb on the ground or on the radar (for T's only)
#if 0
bool CCSBot::NoticeLooseBomb() const bool CCSBot::NoticeLooseBomb() const
{ {
CCSBotManager *ctrl = TheCSBots(); CCSBotManager *ctrl = TheCSBots();
@ -519,7 +523,7 @@ bool CCSBot::CanSeePlantedBomb() const
return false; return false;
} }
#endif
// Return last enemy that hurt us // Return last enemy that hurt us
CBasePlayer *CCSBot::GetAttacker() const CBasePlayer *CCSBot::GetAttacker() const
@ -593,13 +597,13 @@ void CCSBot::SetHidingSpotCheckTimestamp(HidingSpot *spot)
m_checkedHidingSpot[ leastRecent ].timestamp = gpGlobals->time; m_checkedHidingSpot[ leastRecent ].timestamp = gpGlobals->time;
} }
} }
#if 0
// Periodic check of hostage count in case we lost some // Periodic check of hostage count in case we lost some
void CCSBot::UpdateHostageEscortCount() void CCSBot::UpdateHostageEscortCount()
{ {
} }
#endif
// Return true if we are outnumbered by enemies // Return true if we are outnumbered by enemies
bool CCSBot::IsOutnumbered() const bool CCSBot::IsOutnumbered() const
@ -860,8 +864,9 @@ const Vector *FindNearbyRetreatSpot(CCSBot *me, float maxRange)
// Return euclidean distance to farthest escorted hostage. // Return euclidean distance to farthest escorted hostage.
// Return -1 if no hostage is following us. // Return -1 if no hostage is following us.
#if 0
float CCSBot::GetRangeToFarthestEscortedHostage() const float CCSBot::GetRangeToFarthestEscortedHostage() const
{ {
return 0; return 0;
} }
#endif

53
dlls/bot/cs_bot.h

@ -378,7 +378,7 @@ public:
void MoveTo(const Vector *pos, RouteType route = SAFEST_ROUTE); // move to potentially distant position void MoveTo(const Vector *pos, RouteType route = SAFEST_ROUTE); // move to potentially distant position
bool IsMovingTo() const; // return true if we are in the MoveTo state bool IsMovingTo() const; // return true if we are in the MoveTo state
#if 0
void PlantBomb(); void PlantBomb();
void FetchBomb(); // bomb has been dropped - go get it void FetchBomb(); // bomb has been dropped - go get it
@ -394,10 +394,11 @@ public:
bool IsEscapingFromBomb() const; // return true if we are escaping from the bomb bool IsEscapingFromBomb() const; // return true if we are escaping from the bomb
void RescueHostages(); void RescueHostages();
void UseEntity(CBaseEntity *entity); // use the entity // use the entity
bool IsBuying() const; bool IsBuying() const;
#endif
void UseEntity(CBaseEntity *entity);
void Panic(CBasePlayer *enemy); // look around in panic void Panic(CBasePlayer *enemy); // look around in panic
void Follow(CBasePlayer *player); // begin following given Player void Follow(CBasePlayer *player); // begin following given Player
void ContinueFollowing(); // continue following our leader after finishing what we were doing void ContinueFollowing(); // continue following our leader after finishing what we were doing
@ -434,22 +435,22 @@ public:
enum TaskType enum TaskType
{ {
SEEK_AND_DESTROY, SEEK_AND_DESTROY,
PLANT_BOMB, //PLANT_BOMB,
FIND_TICKING_BOMB, //FIND_TICKING_BOMB,
DEFUSE_BOMB, //DEFUSE_BOMB,
GUARD_TICKING_BOMB, //GUARD_TICKING_BOMB,
GUARD_BOMB_DEFUSER, //GUARD_BOMB_DEFUSER,
GUARD_LOOSE_BOMB, //GUARD_LOOSE_BOMB,
GUARD_BOMB_ZONE, //GUARD_BOMB_ZONE,
ESCAPE_FROM_BOMB, //ESCAPE_FROM_BOMB,
HOLD_POSITION, HOLD_POSITION,
FOLLOW, FOLLOW,
VIP_ESCAPE, //VIP_ESCAPE,
GUARD_VIP_ESCAPE_ZONE, //GUARD_VIP_ESCAPE_ZONE,
COLLECT_HOSTAGES, //COLLECT_HOSTAGES,
RESCUE_HOSTAGES, //RESCUE_HOSTAGES,
GUARD_HOSTAGES, //GUARD_HOSTAGES,
GUARD_HOSTAGE_RESCUE_ZONE, //GUARD_HOSTAGE_RESCUE_ZONE,
MOVE_TO_LAST_KNOWN_ENEMY_POSITION, MOVE_TO_LAST_KNOWN_ENEMY_POSITION,
MOVE_TO_SNIPER_SPOT, MOVE_TO_SNIPER_SPOT,
SNIPING, SNIPING,
@ -662,10 +663,11 @@ public:
bool IsPrimaryWeaponEmpty() const; // return true if primary weapon doesn't exist or is totally out of ammo bool IsPrimaryWeaponEmpty() const; // return true if primary weapon doesn't exist or is totally out of ammo
bool IsPistolEmpty() const; // return true if secondary weapon doesn't exist or is totally out of ammo bool IsPistolEmpty() const; // return true if secondary weapon doesn't exist or is totally out of ammo
#if 0
int GetHostageEscortCount() const; int GetHostageEscortCount() const;
void IncreaseHostageEscortCount(); void IncreaseHostageEscortCount();
float GetRangeToFarthestEscortedHostage() const; float GetRangeToFarthestEscortedHostage() const;
#endif
void ResetWaitForHostagePatience(); void ResetWaitForHostagePatience();
void ResetValues(); // reset internal data to initial state void ResetValues(); // reset internal data to initial state
void BotDeathThink(); void BotDeathThink();
@ -808,7 +810,7 @@ private:
// game scenario mechanisms // game scenario mechanisms
CSGameState m_gameState; CSGameState m_gameState;
#if 0
// hostages mechanism // hostages mechanism
byte m_hostageEscortCount; byte m_hostageEscortCount;
void UpdateHostageEscortCount(); void UpdateHostageEscortCount();
@ -816,7 +818,7 @@ private:
bool m_isWaitingForHostage; bool m_isWaitingForHostage;
CountdownTimer m_inhibitWaitingForHostageTimer; CountdownTimer m_inhibitWaitingForHostageTimer;
CountdownTimer m_waitForHostageTimer; CountdownTimer m_waitForHostageTimer;
#endif
// listening mechanism // listening mechanism
Vector m_noisePosition; // position we last heard non-friendly noise Vector m_noisePosition; // position we last heard non-friendly noise
float m_noiseTimestamp; // when we heard it (can get zeroed) float m_noiseTimestamp; // when we heard it (can get zeroed)
@ -1035,11 +1037,12 @@ inline float CCSBot::GetSafeTime() const
{ {
return m_safeTime; return m_safeTime;
} }
#if 0
inline bool CCSBot::IsCarryingBomb() const inline bool CCSBot::IsCarryingBomb() const
{ {
return false; return false;
} }
#endif
inline bool CCSBot::IsFollowing() const inline bool CCSBot::IsFollowing() const
{ {
@ -1373,7 +1376,7 @@ inline CCSBot::ZoomType CCSBot::GetZoomLevel() const
return HIGH_ZOOM; return HIGH_ZOOM;
} }
#if 0
inline int CCSBot::GetHostageEscortCount() const inline int CCSBot::GetHostageEscortCount() const
{ {
return m_hostageEscortCount; return m_hostageEscortCount;
@ -1389,7 +1392,7 @@ inline void CCSBot::ResetWaitForHostagePatience()
m_isWaitingForHostage = false; m_isWaitingForHostage = false;
m_inhibitWaitingForHostageTimer.Invalidate(); m_inhibitWaitingForHostageTimer.Invalidate();
} }
#endif
inline float CCSBot::GetFeetZ() const inline float CCSBot::GetFeetZ() const
{ {
if (IsCrouching()) if (IsCrouching())
@ -1642,13 +1645,13 @@ public:
{ {
// these areas are very slow to move through // these areas are very slow to move through
float crouchPenalty = (m_route == FASTEST_ROUTE) ? 20.0f : 5.0f; float crouchPenalty = (m_route == FASTEST_ROUTE) ? 20.0f : 5.0f;
#if 0 /// TODO: useful in coop modes
// avoid crouch areas if we are rescuing hostages // avoid crouch areas if we are rescuing hostages
if (m_bot->GetHostageEscortCount()) if (m_bot->GetHostageEscortCount())
{ {
crouchPenalty *= 3.0f; crouchPenalty *= 3.0f;
} }
#endif
cost += crouchPenalty * dist; cost += crouchPenalty * dist;
} }

22
dlls/bot/cs_bot_chatter.cpp

@ -84,7 +84,7 @@ void BotHelpMeme::Interpret(CCSBot *sender, CCSBot *receiver) const
} }
// A teammate reported information about a bombsite // A teammate reported information about a bombsite
#if 0
void BotBombsiteStatusMeme::Interpret(CCSBot *sender, CCSBot *receiver) const void BotBombsiteStatusMeme::Interpret(CCSBot *sender, CCSBot *receiver) const
{ {
// remember this bombsite's status // remember this bombsite's status
@ -134,7 +134,7 @@ void BotBombStatusMeme::Interpret(CCSBot *sender, CCSBot *receiver) const
} }
} }
} }
#endif
// A teammate has asked that we follow him // A teammate has asked that we follow him
void BotFollowMeme::Interpret(CCSBot *sender, CCSBot *receiver) const void BotFollowMeme::Interpret(CCSBot *sender, CCSBot *receiver) const
@ -195,7 +195,7 @@ void BotDefendHereMeme::Interpret(CCSBot *sender, CCSBot *receiver) const
} }
// A teammate has asked where the bomb is planted // A teammate has asked where the bomb is planted
#if 0
void BotWhereBombMeme::Interpret(CCSBot *sender, CCSBot *receiver) const void BotWhereBombMeme::Interpret(CCSBot *sender, CCSBot *receiver) const
{ {
int zone = receiver->GetGameState()->GetPlantedBombsite(); int zone = receiver->GetGameState()->GetPlantedBombsite();
@ -203,14 +203,14 @@ void BotWhereBombMeme::Interpret(CCSBot *sender, CCSBot *receiver) const
if (zone != CSGameState::UNKNOWN) if (zone != CSGameState::UNKNOWN)
receiver->GetChatter()->FoundPlantedBomb(zone); receiver->GetChatter()->FoundPlantedBomb(zone);
} }
#endif
// A teammate has asked us to report in // A teammate has asked us to report in
void BotRequestReportMeme::Interpret(CCSBot *sender, CCSBot *receiver) const void BotRequestReportMeme::Interpret(CCSBot *sender, CCSBot *receiver) const
{ {
receiver->GetChatter()->ReportingIn(); receiver->GetChatter()->ReportingIn();
} }
#if 0
// A teammate told us all the hostages are gone // A teammate told us all the hostages are gone
void BotAllHostagesGoneMeme::Interpret(CCSBot *sender, CCSBot *receiver) const void BotAllHostagesGoneMeme::Interpret(CCSBot *sender, CCSBot *receiver) const
@ -236,6 +236,7 @@ void BotHostageBeingTakenMeme::Interpret(CCSBot *sender, CCSBot *receiver) const
// acknowledge // acknowledge
receiver->GetChatter()->Say("Affirmative"); receiver->GetChatter()->Say("Affirmative");
} }
#endif
BotSpeakable::BotSpeakable() BotSpeakable::BotSpeakable()
{ {
@ -1694,7 +1695,7 @@ void BotChatterInterface::ReportingIn()
// where are we // where are we
Place place = m_me->GetPlace(); Place place = m_me->GetPlace();
SayWhere(say, place); SayWhere(say, place);
#if 0
// what are we doing // what are we doing
switch (m_me->GetTask()) switch (m_me->GetTask())
{ {
@ -1741,7 +1742,7 @@ void BotChatterInterface::ReportingIn()
break; break;
} }
} }
#endif
// what do we see // what do we see
if (m_me->IsAttacking()) if (m_me->IsAttacking())
{ {
@ -1896,7 +1897,7 @@ void BotChatterInterface::Negative()
say->AppendPhrase(TheBotPhrases->GetPhrase("Negative")); say->AppendPhrase(TheBotPhrases->GetPhrase("Negative"));
AddStatement(say); AddStatement(say);
} }
#if 0
void BotChatterInterface::GoingToPlantTheBomb(Place place) void BotChatterInterface::GoingToPlantTheBomb(Place place)
{ {
if (TheCSBots()->IsRoundOver()) if (TheCSBots()->IsRoundOver())
@ -2078,7 +2079,7 @@ void BotChatterInterface::FoundPlantedBomb(int zoneIndex)
say->AttachMeme(new BotBombsiteStatusMeme(zoneIndex, BotBombsiteStatusMeme::PLANTED)); say->AttachMeme(new BotBombsiteStatusMeme(zoneIndex, BotBombsiteStatusMeme::PLANTED));
AddStatement(say); AddStatement(say);
} }
#endif
void BotChatterInterface::Scared() void BotChatterInterface::Scared()
{ {
const float minInterval = 10.0f; const float minInterval = 10.0f;
@ -2141,7 +2142,7 @@ void BotChatterInterface::AnnouncePlan(const char *phraseName, Place place)
say->SetStartTime(ctrl->GetRoundStartTime() + RANDOM_FLOAT(2.0, 3.0f)); say->SetStartTime(ctrl->GetRoundStartTime() + RANDOM_FLOAT(2.0, 3.0f));
AddStatement(say); AddStatement(say);
} }
#if 0
void BotChatterInterface::GuardingHostages(Place place, bool isPlan) void BotChatterInterface::GuardingHostages(Place place, bool isPlan)
{ {
if (TheCSBots()->IsRoundOver()) if (TheCSBots()->IsRoundOver())
@ -2256,3 +2257,4 @@ void BotChatterInterface::FriendlyFire()
say->SetStartTime(gpGlobals->time + RANDOM_FLOAT(0.3f, 0.5f)); say->SetStartTime(gpGlobals->time + RANDOM_FLOAT(0.3f, 0.5f));
AddStatement(say); AddStatement(say);
} }
#endif

14
dlls/bot/cs_bot_chatter.h

@ -54,7 +54,7 @@ public:
void Transmit(CCSBot *sender) const; // transmit meme to other bots void Transmit(CCSBot *sender) const; // transmit meme to other bots
virtual void Interpret(CCSBot *sender, CCSBot *receiver) const = 0; // cause the given bot to act on this meme virtual void Interpret(CCSBot *sender, CCSBot *receiver) const = 0; // cause the given bot to act on this meme
}; };
#if 0
class BotAllHostagesGoneMeme: public BotMeme class BotAllHostagesGoneMeme: public BotMeme
{ {
public: public:
@ -66,7 +66,7 @@ class BotHostageBeingTakenMeme: public BotMeme
public: public:
virtual void Interpret(CCSBot *sender, CCSBot *receiver) const; // cause the given bot to act on this meme virtual void Interpret(CCSBot *sender, CCSBot *receiver) const; // cause the given bot to act on this meme
}; };
#endif
class BotHelpMeme: public BotMeme class BotHelpMeme: public BotMeme
{ {
public: public:
@ -79,7 +79,7 @@ public:
private: private:
Place m_place; Place m_place;
}; };
#if 0
class BotBombsiteStatusMeme: public BotMeme class BotBombsiteStatusMeme: public BotMeme
{ {
public: public:
@ -113,7 +113,7 @@ private:
CSGameState::BombState m_state; CSGameState::BombState m_state;
Vector m_pos; Vector m_pos;
}; };
#endif
class BotFollowMeme: public BotMeme class BotFollowMeme: public BotMeme
{ {
public: public:
@ -133,11 +133,13 @@ private:
Vector m_pos; Vector m_pos;
}; };
#if 0
class BotWhereBombMeme: public BotMeme class BotWhereBombMeme: public BotMeme
{ {
public: public:
virtual void Interpret(CCSBot *sender, CCSBot *receiver) const; // cause the given bot to act on this meme virtual void Interpret(CCSBot *sender, CCSBot *receiver) const; // cause the given bot to act on this meme
}; };
#endif
class BotRequestReportMeme: public BotMeme class BotRequestReportMeme: public BotMeme
{ {
@ -499,7 +501,7 @@ public:
void PinnedDown(); void PinnedDown();
void Scared(); void Scared();
void HeardNoise(const Vector *pos); void HeardNoise(const Vector *pos);
#if 0
void TheyPickedUpTheBomb(); void TheyPickedUpTheBomb();
void GoingToPlantTheBomb(Place place); void GoingToPlantTheBomb(Place place);
void BombsiteClear(int zoneIndex); void BombsiteClear(int zoneIndex);
@ -518,7 +520,7 @@ public:
void TalkingToHostages(); void TalkingToHostages();
void EscortingHostages(); void EscortingHostages();
NOXREF void HostageDown(); NOXREF void HostageDown();
#endif
void CelebrateWin(); void CelebrateWin();
void Encourage(const char *phraseName, float repeatInterval = 10.0f, float lifetime = 3.0f); // "encourage" the player to do the scenario void Encourage(const char *phraseName, float repeatInterval = 10.0f, float lifetime = 3.0f); // "encourage" the player to do the scenario

4
dlls/bot/cs_bot_init.cpp

@ -221,10 +221,10 @@ void CCSBot::ResetValues()
m_lastRadioSentTimestamp = 0.0f; m_lastRadioSentTimestamp = 0.0f;
m_radioSubject = NULL; m_radioSubject = NULL;
m_voiceFeedbackEndTimestamp = 0.0f; m_voiceFeedbackEndTimestamp = 0.0f;
#if 0
m_hostageEscortCount = 0; m_hostageEscortCount = 0;
m_hostageEscortCountTimestamp = 0.0f; m_hostageEscortCountTimestamp = 0.0f;
#endif
m_noisePosition = Vector(0, 0, 0); m_noisePosition = Vector(0, 0, 0);
m_noiseTimestamp = 0.0f; m_noiseTimestamp = 0.0f;
m_noiseCheckTimestamp = 0.0f; m_noiseCheckTimestamp = 0.0f;

17
dlls/bot/cs_bot_statemachine.cpp

@ -24,13 +24,13 @@ void CCSBot::Idle()
SetTask(SEEK_AND_DESTROY); SetTask(SEEK_AND_DESTROY);
SetState(&m_idleState); SetState(&m_idleState);
} }
#if 0
void CCSBot::EscapeFromBomb() void CCSBot::EscapeFromBomb()
{ {
// SetTask(ESCAPE_FROM_BOMB); // SetTask(ESCAPE_FROM_BOMB);
// SetState(&m_escapeFromBombState); // SetState(&m_escapeFromBombState);
} }
#endif
void CCSBot::Follow(CBasePlayer *player) void CCSBot::Follow(CBasePlayer *player)
{ {
if (player == NULL) if (player == NULL)
@ -67,12 +67,12 @@ void CCSBot::StopFollowing()
} }
// Begin process of rescuing hostages // Begin process of rescuing hostages
#if 0
void CCSBot::RescueHostages() void CCSBot::RescueHostages()
{ {
SetTask(RESCUE_HOSTAGES); SetTask(RESCUE_HOSTAGES);
} }
#endif
// Use the entity // Use the entity
void CCSBot::UseEntity(CBaseEntity *entity) void CCSBot::UseEntity(CBaseEntity *entity)
@ -336,7 +336,7 @@ bool CCSBot::IsAttacking() const
} }
// Return true if we are escaping from the bomb // Return true if we are escaping from the bomb
#if 0
bool CCSBot::IsEscapingFromBomb() const bool CCSBot::IsEscapingFromBomb() const
{ {
// if (m_state == static_cast<const BotState *>(&m_escapeFromBombState)) // if (m_state == static_cast<const BotState *>(&m_escapeFromBombState))
@ -354,7 +354,7 @@ bool CCSBot::IsDefusingBomb() const
return false; return false;
} }
#endif
// Return true if we are hiding // Return true if we are hiding
bool CCSBot::IsHiding() const bool CCSBot::IsHiding() const
@ -396,7 +396,7 @@ bool CCSBot::IsMovingTo() const
} }
// Return true if we are buying // Return true if we are buying
#if 0
bool CCSBot::IsBuying() const bool CCSBot::IsBuying() const
{ {
// if (m_state == static_cast<const BotState *>(&m_buyState)) // if (m_state == static_cast<const BotState *>(&m_buyState))
@ -404,6 +404,7 @@ bool CCSBot::IsBuying() const
return false; return false;
} }
#endif
// Move to potentially distant position // Move to potentially distant position
@ -414,6 +415,7 @@ void CCSBot::MoveTo(const Vector *pos, RouteType route)
SetState(&m_moveToState); SetState(&m_moveToState);
} }
#if 0
void CCSBot::PlantBomb() void CCSBot::PlantBomb()
{ {
// SetState(&m_plantBombState); // SetState(&m_plantBombState);
@ -430,6 +432,7 @@ void CCSBot::DefuseBomb()
{ {
// SetState(&m_defuseBombState); // SetState(&m_defuseBombState);
} }
#endif
// Investigate recent enemy noise // Investigate recent enemy noise

10
dlls/bot/cs_bot_update.cpp

@ -476,7 +476,7 @@ void CCSBot::Update()
} }
// TODO: This doesn't work if we are restricted to just knives and sniper rifles because we cant use the rifle at close range // TODO: This doesn't work if we are restricted to just knives and sniper rifles because we cant use the rifle at close range
if (!IsSafe() && !IsUsingGrenade() && IsUsingKnife() && !IsEscapingFromBomb()) if (!IsSafe() && !IsUsingGrenade() && IsUsingKnife())
{ {
EquipBestWeapon(); EquipBestWeapon();
} }
@ -534,7 +534,7 @@ void CCSBot::Update()
// check encounter spots // check encounter spots
UpdatePeripheralVision(); UpdatePeripheralVision();
#if 0
// Update gamestate // Update gamestate
if (m_bomber != NULL) if (m_bomber != NULL)
GetChatter()->SpottedBomber(GetBomber()); GetChatter()->SpottedBomber(GetBomber());
@ -594,7 +594,7 @@ void CCSBot::Update()
#endif #endif
} }
} }
#endif
// Follow nearby humans if our co-op is high and we have nothing else to do // Follow nearby humans if our co-op is high and we have nothing else to do
// If we were just following someone, don't auto-follow again for a short while to // If we were just following someone, don't auto-follow again for a short while to
// give us a chance to do something else. // give us a chance to do something else.
@ -715,7 +715,7 @@ void CCSBot::Update()
ClearMovement(); ClearMovement();
} }
#endif #endif
#if 0
// if we get too far ahead of the hostages we are escorting, wait for them // if we get too far ahead of the hostages we are escorting, wait for them
if (!IsAttacking() && m_inhibitWaitingForHostageTimer.IsElapsed()) if (!IsAttacking() && m_inhibitWaitingForHostageTimer.IsElapsed())
{ {
@ -746,7 +746,7 @@ void CCSBot::Update()
} }
} }
} }
#endif
// remember our prior safe time status // remember our prior safe time status
m_wasSafe = IsSafe(); m_wasSafe = IsSafe();
} }

9
dlls/bot/cs_bot_weapon.cpp

@ -702,10 +702,13 @@ void CCSBot::ReloadCheck()
// don't bother to reload if there are no enemies left // don't bother to reload if there are no enemies left
if (GetEnemiesRemaining() == 0) if (GetEnemiesRemaining() == 0)
return; return;
#if 0
if (IsDefusingBomb() || IsActiveWeaponReloading()) if (IsDefusingBomb() || IsActiveWeaponReloading())
return; return;
#else
if (IsActiveWeaponReloading())
return;
#endif
if (IsActiveWeaponClipEmpty()) if (IsActiveWeaponClipEmpty())
{ {
#if 0 #if 0
@ -774,7 +777,7 @@ void CCSBot::SilencerCheck()
// longer than reload check because reloading should take precedence // longer than reload check because reloading should take precedence
const float safeSilencerWaitTime = 3.5f; const float safeSilencerWaitTime = 3.5f;
if (IsDefusingBomb() || IsActiveWeaponReloading() || IsAttacking()) if (IsActiveWeaponReloading() || IsAttacking())
return; return;
// M4A1 and USP are the only weapons with removable silencers // M4A1 and USP are the only weapons with removable silencers

3
dlls/bot/states/cs_bot_attack.cpp

@ -30,10 +30,11 @@ void AttackState::OnEnter(CCSBot *me)
m_shieldToggleTimestamp = gpGlobals->time + RANDOM_FLOAT(2.0f, 10.0f); m_shieldToggleTimestamp = gpGlobals->time + RANDOM_FLOAT(2.0f, 10.0f);
m_shieldForceOpen = false; m_shieldForceOpen = false;
#if 0
// if we encountered someone while escaping, grab our weapon and fight! // if we encountered someone while escaping, grab our weapon and fight!
if (me->IsEscapingFromBomb()) if (me->IsEscapingFromBomb())
me->EquipBestWeapon(); me->EquipBestWeapon();
#endif
if (me->IsUsingKnife()) if (me->IsUsingKnife())
{ {
// can't crouch and hold with a knife // can't crouch and hold with a knife

4
dlls/bot/states/cs_bot_follow.cpp

@ -83,7 +83,7 @@ void FollowState::OnUpdate(CCSBot *me)
me->Idle(); me->Idle();
return; return;
} }
#if 0
// if we are carrying the bomb and at a bombsite, plant // if we are carrying the bomb and at a bombsite, plant
if (me->IsCarryingBomb() && me->IsAtBombsite()) if (me->IsCarryingBomb() && me->IsAtBombsite())
{ {
@ -95,7 +95,7 @@ void FollowState::OnUpdate(CCSBot *me)
me->GetChatter()->PlantingTheBomb(me->GetPlace()); me->GetChatter()->PlantingTheBomb(me->GetPlace());
return; return;
} }
#endif
// look around // look around
me->UpdateLookAround(); me->UpdateLookAround();

5
dlls/bot/states/cs_bot_hide.cpp

@ -49,8 +49,10 @@ void HideState::OnUpdate(CCSBot *me)
// wait until finished reloading to leave hide state // wait until finished reloading to leave hide state
if (!me->IsActiveWeaponReloading()) if (!me->IsActiveWeaponReloading())
{ {
if (gpGlobals->time - me->GetStateTimestamp() > m_duration) if (gpGlobals->time - me->GetStateTimestamp() > m_duration)
{ {
#if 0
if (me->GetTask() == CCSBot::GUARD_LOOSE_BOMB) if (me->GetTask() == CCSBot::GUARD_LOOSE_BOMB)
{ {
// if we're guarding the loose bomb, continue to guard it but pick a new spot // if we're guarding the loose bomb, continue to guard it but pick a new spot
@ -83,7 +85,7 @@ void HideState::OnUpdate(CCSBot *me)
return; return;
} }
} }
#endif
me->Idle(); me->Idle();
return; return;
} }
@ -220,6 +222,7 @@ void HideState::OnUpdate(CCSBot *me)
} }
#endif #endif
bool isSettledInSniper = (me->IsSniper() && m_isAtSpot) ? true : false; bool isSettledInSniper = (me->IsSniper() && m_isAtSpot) ? true : false;
// only investigate noises if we are initiating attacks, and we aren't a "settled in" sniper // only investigate noises if we are initiating attacks, and we aren't a "settled in" sniper

3
dlls/bot/states/cs_bot_idle.cpp

@ -53,6 +53,7 @@ void IdleState::OnUpdate(CCSBot *me)
// if round is over, hunt // if round is over, hunt
if (me->GetGameState()->IsRoundOver()) if (me->GetGameState()->IsRoundOver())
{ {
#if 0
// if we are escorting hostages, try to get to the rescue zone // if we are escorting hostages, try to get to the rescue zone
if (me->GetHostageEscortCount()) if (me->GetHostageEscortCount())
{ {
@ -64,7 +65,7 @@ void IdleState::OnUpdate(CCSBot *me)
me->PrintIfWatched("Trying to rescue hostages at the end of the round\n"); me->PrintIfWatched("Trying to rescue hostages at the end of the round\n");
return; return;
} }
#endif
me->Hunt(); me->Hunt();
return; return;
} }

5
dlls/bot/states/cs_bot_move_to.cpp

@ -17,8 +17,11 @@ void MoveToState::OnEnter(CCSBot *me)
RouteType route; RouteType route;
switch (me->GetTask()) switch (me->GetTask())
{ {
// maybe also fastest way to healthkits??
#if 0
case CCSBot::FIND_TICKING_BOMB: case CCSBot::FIND_TICKING_BOMB:
case CCSBot::DEFUSE_BOMB: case CCSBot::DEFUSE_BOMB:
#endif
case CCSBot::MOVE_TO_LAST_KNOWN_ENEMY_POSITION: case CCSBot::MOVE_TO_LAST_KNOWN_ENEMY_POSITION:
route = FASTEST_ROUTE; route = FASTEST_ROUTE;
break; break;
@ -243,6 +246,7 @@ void MoveToState::OnUpdate(CCSBot *me)
// reached destination // reached destination
switch (me->GetTask()) switch (me->GetTask())
{ {
#if 0
case CCSBot::PLANT_BOMB: case CCSBot::PLANT_BOMB:
{ {
// if we are at bombsite with the bomb, plant it // if we are at bombsite with the bomb, plant it
@ -273,6 +277,7 @@ void MoveToState::OnUpdate(CCSBot *me)
} }
break; break;
} }
#endif
case CCSBot::MOVE_TO_LAST_KNOWN_ENEMY_POSITION: case CCSBot::MOVE_TO_LAST_KNOWN_ENEMY_POSITION:
{ {
CBasePlayer *victim = static_cast<CBasePlayer *>(me->GetTaskEntity()); CBasePlayer *victim = static_cast<CBasePlayer *>(me->GetTaskEntity());

Loading…
Cancel
Save