Browse Source

Clean gamestate part

hlzbot-dirty
mittorn 8 years ago
parent
commit
70af6c8e9e
  1. 3
      dlls/bot/cs_bot_update.cpp
  2. 11
      dlls/bot/cs_gamestate.cpp
  3. 8
      dlls/bot/cs_gamestate.h

3
dlls/bot/cs_bot_update.cpp

@ -604,8 +604,7 @@ void CCSBot::Update() @@ -604,8 +604,7 @@ void CCSBot::Update()
&& GetProfile()->GetTeamwork() > minAutoFollowTeamwork
&& CanAutoFollow()
&& !IsBusy()
&& !IsFollowing()
&& !GetGameState()->IsAtPlantedBombsite())
&& !IsFollowing())
{
// chance of following is proportional to teamwork attribute
if (GetProfile()->GetTeamwork() > RANDOM_FLOAT(0.0f, 1.0f))

11
dlls/bot/cs_gamestate.cpp

@ -5,9 +5,10 @@ CSGameState::CSGameState(CCSBot *owner) @@ -5,9 +5,10 @@ CSGameState::CSGameState(CCSBot *owner)
m_owner = owner;
m_isRoundOver = false;
// m_bombState = MOVING;
#if 0
m_lastSawBomber.Invalidate();
m_lastSawLooseBomb.Invalidate();
#endif
m_validateInterval.Invalidate();
// m_isPlantedBombPosKnown = false;
// m_plantedBombsite = UNKNOWN;
@ -36,12 +37,11 @@ void CSGameState::Reset() @@ -36,12 +37,11 @@ void CSGameState::Reset()
CCSBotManager *ctrl = TheCSBots();
m_isRoundOver = false;
#if 0
// bomb
m_bombState = MOVING;
m_lastSawBomber.Invalidate();
m_lastSawLooseBomb.Invalidate();
#if 0
m_bombsiteCount = ctrl->GetZoneCount();
m_isPlantedBombPosKnown = false;
@ -110,7 +110,7 @@ bool CSGameState::IsRoundOver() const @@ -110,7 +110,7 @@ bool CSGameState::IsRoundOver() const
{
return m_isRoundOver;
}
#if 0
void CSGameState::SetBombState(BombState state)
{
// if state changed, reset "last seen" timestamps
@ -309,6 +309,7 @@ bool CSGameState::IsBombsiteClear(int zoneIndex) const @@ -309,6 +309,7 @@ bool CSGameState::IsBombsiteClear(int zoneIndex) const
#endif
return false;
}
#endif
#if 0
void CSGameState::InitializeHostageInfo()
{
@ -692,4 +693,4 @@ void CSGameState::AllHostagesGone() @@ -692,4 +693,4 @@ void CSGameState::AllHostagesGone()
for (int i = 0; i < m_hostageCount; ++i)
m_hostage[i].isValid = false;
}
#endif
#endif

8
dlls/bot/cs_gamestate.h

@ -44,7 +44,7 @@ public: @@ -44,7 +44,7 @@ public:
void Reset();
void OnEvent(GameEventType event, CBaseEntity *entity, CBaseEntity *other); // Event handling
bool IsRoundOver() const; // true if round has been won or lost (but not yet reset)
#if 0
// bomb defuse scenario
enum BombState
{
@ -81,14 +81,14 @@ public: @@ -81,14 +81,14 @@ public:
void ClearBombsite(int zoneIndex); // mark bombsite as clear
const Vector *GetBombPosition() const; // return where we think the bomb is, or NULL if we don't know
#endif
// hostage rescue scenario
//enum ValidateStatusType:unsigned char //C++11 feature
private:
CCSBot *m_owner; // who owns this gamestate
bool m_isRoundOver; // true if round is over, but no yet reset
#if 0
// bomb defuse scenario
void SetBombState(BombState state);
BombState GetBombState() { return m_bombState; }
@ -100,7 +100,7 @@ private: @@ -100,7 +100,7 @@ private:
IntervalTimer m_lastSawLooseBomb;
Vector m_looseBombPos;
#endif
CountdownTimer m_validateInterval;
};

Loading…
Cancel
Save