a little cleanup of code

This commit is contained in:
jeefo 2016-09-10 19:31:38 +03:00
commit c4d6ce3c45
14 changed files with 430 additions and 343 deletions

View file

@ -63,7 +63,8 @@ enum GameFlags
GAME_CZERO = (1 << 2), // Counter-Strike: Condition Zero
GAME_LEGACY = (1 << 3), // Counter-Strike 1.3-1.5 with/without Steam
GAME_MOBILITY = (1 << 4), // additional flag that bot is running on android (additional flag)
GAME_OFFICIAL_CSBOT = (1 << 5) // additional flag that indicates official cs bots are in game
GAME_OFFICIAL_CSBOT = (1 << 5), // additional flag that indicates official cs bots are in game
GAME_METAMOD = (1 << 6)
};
// log levels
@ -125,6 +126,14 @@ enum ClientFlags
CF_ADMIN = (1 << 2)
};
// bot create status
enum BotCreationResult
{
BOT_RESULT_CREATED,
BOT_RESULT_MAX_PLAYERS_REACHED,
BOT_RESULT_NAV_ERROR
};
// radio messages
enum RadioMessage_t
{
@ -802,6 +811,7 @@ private:
bool m_moveToGoal; // bot currently moving to goal??
bool m_isStuck; // bot is stuck
bool m_isReloading; // bot is reloading a gun
bool m_forceRadio; // should bot use radio anyway?
int m_reloadState; // current reload state
int m_voicePitch; // bot voice pitch
@ -988,7 +998,6 @@ private:
int ChangeWptIndex (int waypointIndex);
bool IsDeadlyDrop (const Vector &to);
bool OutOfBombTimer (void);
void SelectLeaderEachTeam (int team);
Vector CheckThrow (const Vector &start, const Vector &stop);
Vector CheckToss (const Vector &start, const Vector &stop);
@ -1239,8 +1248,9 @@ private:
int m_lastWinner; // the team who won previous round
int m_balanceCount; // limit of bots to add
bool m_economicsGood[2]; // is team able to buy anything
bool m_deathMsgSent; // for fakeping
bool m_leaderChoosen[SPECTATOR]; // is team leader choose theese round
bool m_economicsGood[SPECTATOR]; // is team able to buy anything
bool m_deathMsgSent; // for fake ping
Array <edict_t *> m_activeGrenades; // holds currently active grenades in the map
Array <edict_t *> m_trackedPlayers; // holds array of connected players, and waits the player joins team
@ -1248,13 +1258,13 @@ private:
edict_t *m_killerEntity; // killer entity for bots
protected:
int CreateBot (const String &name, int difficulty, int personality, int team, int member, bool isConsoleCmd);
BotCreationResult CreateBot (const String &name, int difficulty, int personality, int team, int member, bool isConsoleCmd);
public:
BotManager (void);
~BotManager (void);
bool EconomicsValid (int team) { return m_economicsGood[team]; }
bool IsEcoValid (int team) { return m_economicsGood[team]; }
int GetLastWinner (void) const { return m_lastWinner; }
void SetLastWinner (int winner) { m_lastWinner = winner; }
@ -1296,6 +1306,7 @@ public:
void AddPlayerToCheckTeamQueue (edict_t *ent);
void VerifyPlayersHasJoinedTeam (int &desiredCount);
void SelectLeaderEachTeam (int team, bool reset);
void ListBots (void);
void SetWeaponMode (int selection);
@ -1322,7 +1333,6 @@ public:
void SendDeathMsgFix (void);
};
// waypoint operation class
class Waypoint : public Singleton <Waypoint>
{
@ -1335,6 +1345,7 @@ private:
bool m_isOnLadder;
bool m_endJumpPoint;
bool m_learnJumpWaypoint;
bool m_waypointsChanged;
float m_timeJumpStarted;
Vector m_learnVelocity;
@ -1421,7 +1432,9 @@ public:
int GetPathDistance (int srcIndex, int destIndex);
Path *GetPath (int id);
const char *GetWaypointInfo (int id);
char *GetInfo (void) { return m_infoBuffer; }
bool HasChanged (void) { return m_waypointsChanged; }
void SetFindIndex (int index);
void SetLearnJumpWaypoint (void);

View file

@ -13,15 +13,11 @@ extern bool g_canSayBombPlanted;
extern bool g_bombPlanted;
extern bool g_bombSayString;
extern bool g_roundEnded;
extern bool g_radioInsteadVoice;
extern bool g_waypointOn;
extern bool g_waypointsChanged;
extern bool g_autoWaypoint;
extern bool g_botsCanPause;
extern bool g_editNoclip;
extern bool g_isMetamod;
extern bool g_isCommencing;
extern bool g_leaderChoosen[2];
extern float g_autoPathDistance;
extern float g_timeBombPlanted;
@ -29,7 +25,6 @@ extern float g_timeNextBombUpdate;
extern float g_lastChatTime;
extern float g_timeRoundEnd;
extern float g_timeRoundMid;
extern float g_timeNextBombUpdate;
extern float g_timeRoundStart;
extern float g_timePerSecondUpdate;
extern float g_lastRadioTime[2];
@ -71,10 +66,6 @@ extern edict_t *g_hostEntity;
extern Library *g_gameLib;
extern gamefuncs_t g_functionTable;
extern EntityAPI_t g_entityAPI;
extern FuncPointers_t g_funcPointers;
extern NewEntityAPI_t g_getNewEntityAPI;
extern BlendAPI_t g_serverBlendingAPI;
static inline bool IsNullString (const char *input)
{

View file

@ -11,17 +11,17 @@
// general product information
#define PRODUCT_NAME "Yet Another POD-Bot"
#define PRODUCT_VERSION "2.73"
#define PRODUCT_VERSION "2.8"
#define PRODUCT_AUTHOR "YaPB Dev Team"
#define PRODUCT_URL "https://yapb.jeefo.net"
#define PRODUCT_URL "https://yapb.jeefo.net/"
#define PRODUCT_EMAIL "dmitry@jeefo.net"
#define PRODUCT_LOGTAG "YAPB"
#define PRODUCT_DESCRIPTION PRODUCT_NAME " v" PRODUCT_VERSION " - The Counter-Strike Bot"
#define PRODUCT_COPYRIGHT "Copyright © 2003-2016, by " PRODUCT_AUTHOR
#define PRODUCT_COPYRIGHT "Copyright © 1999-2017, by " PRODUCT_AUTHOR
#define PRODUCT_LEGAL "Half-Life, Counter-Strike, Counter-Strike: Condition Zero, Steam, Valve is a trademark of Valve Corporation"
#define PRODUCT_ORIGINAL_NAME "yapb.dll"
#define PRODUCT_INTERNAL_NAME "skybot"
#define PRODUCT_VERSION_DWORD_INTERNAL 2,73
#define PRODUCT_VERSION_DWORD_INTERNAL 2,8
#define PRODUCT_VERSION_DWORD PRODUCT_VERSION_DWORD_INTERNAL,0
#define PRODUCT_SUPPORT_VERSION "1.0 - CZ"
#define PRODUCT_COMMENTS "http://github.com/jeefo/yapb/"