From 1259276bcb3c28f2a16a43f7beef23da5bbca514 Mon Sep 17 00:00:00 2001 From: jeefo Date: Wed, 9 Mar 2016 23:32:45 +0300 Subject: [PATCH] bump version number fixed some of coverity warnings --- include/compress.h | 2 +- include/corelib.h | 2 ++ include/resource.h | 4 ++-- source/basecode.cpp | 2 +- source/combat.cpp | 2 +- source/engine.cpp | 8 ++++---- source/navigate.cpp | 6 ++++-- source/support.cpp | 3 --- 8 files changed, 15 insertions(+), 14 deletions(-) diff --git a/include/compress.h b/include/compress.h index b64f3f3..3d1f00b 100644 --- a/include/compress.h +++ b/include/compress.h @@ -154,7 +154,7 @@ public: memset (m_textBuffer, 0, sizeof (m_textBuffer)); memset (m_right, 0, sizeof (m_right)); - memset (m_left, 0, sizeof (m_right)); + memset (m_left, 0, sizeof (m_left)); memset (m_parent, 0, sizeof (m_parent)); } diff --git a/include/corelib.h b/include/corelib.h index dbfb4c5..d9d5860 100644 --- a/include/corelib.h +++ b/include/corelib.h @@ -23,6 +23,8 @@ #ifdef _WIN32 #include +#else +#include #endif // diff --git a/include/resource.h b/include/resource.h index 931b0df..b702fbe 100644 --- a/include/resource.h +++ b/include/resource.h @@ -11,7 +11,7 @@ // general product information #define PRODUCT_NAME "Yet Another POD-Bot" -#define PRODUCT_VERSION "2.7.2" +#define PRODUCT_VERSION "2.7.3" #define PRODUCT_AUTHOR "YaPB Dev Team" #define PRODUCT_URL "https://yapb.jeefo.net" #define PRODUCT_EMAIL "dmitry@jeefo.net" @@ -21,7 +21,7 @@ #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,7,2 +#define PRODUCT_VERSION_DWORD_INTERNAL 2,7,3 #define PRODUCT_VERSION_DWORD PRODUCT_VERSION_DWORD_INTERNAL,0 #define PRODUCT_SUPPORT_VERSION "1.0 - CZ" #define PRODUCT_COMMENTS "http://github.com/jeefo/yapb/" diff --git a/source/basecode.cpp b/source/basecode.cpp index 7d46a97..18d65df 100644 --- a/source/basecode.cpp +++ b/source/basecode.cpp @@ -235,7 +235,7 @@ void Bot::CheckGrenadeThrow (void) int friendCount = GetNearbyFriendsNearPosition (path->origin, 256.0f); - if (friendCount != 0 || !(m_difficulty == 4 && friendCount != 0)) + if (friendCount > 0 && m_difficulty < 4) continue; m_throw = path->origin; diff --git a/source/combat.cpp b/source/combat.cpp index 4b3335d..1c35277 100644 --- a/source/combat.cpp +++ b/source/combat.cpp @@ -1022,7 +1022,7 @@ void Bot::CombatFight (void) if (m_currentWeapon == WEAPON_KNIFE) // knife? approach = 100; - if ((m_states & STATE_SUSPECT_ENEMY) && !(m_states & STATE_SEEING_ENEMY)) // if suspecting enemy stand still + else if ((m_states & STATE_SUSPECT_ENEMY) && !(m_states & STATE_SEEING_ENEMY)) // if suspecting enemy stand still approach = 49; else if (m_isReloading || m_isVIP) // if reloading or vip back off approach = 29; diff --git a/source/engine.cpp b/source/engine.cpp index 13ff960..81425ad 100644 --- a/source/engine.cpp +++ b/source/engine.cpp @@ -18,7 +18,7 @@ void Engine::Precache (edict_t *startEntity) m_isBotCommand = false; m_argumentCount = 0; - m_arguments[0] = { 0, }; + m_arguments[0] = 0x0; m_localEntity = NULL; m_startEntity = startEntity; @@ -324,7 +324,7 @@ void Engine::IssueBotCommand (edict_t *ent, const char *fmt, ...) if (IsNullString (string)) return; - m_arguments[0] = { 0, }; + m_arguments[0] = 0x0; m_argumentCount = 0; m_isBotCommand = true; @@ -377,7 +377,7 @@ void Engine::IssueBotCommand (edict_t *ent, const char *fmt, ...) } m_isBotCommand = false; - m_arguments[0] = { 0, }; + m_arguments[0] = 0x0; m_argumentCount = 0; } @@ -386,7 +386,7 @@ const char *Engine::ExtractSingleField (const char *string, int id, bool termina // this function gets and returns a particular field in a string where several strings are concatenated static char field[256]; - field[0] = { 0, }; + field[0] = 0x0; int pos = 0, count = 0, start = 0, stop = 0; int length = strlen (string); diff --git a/source/navigate.cpp b/source/navigate.cpp index a1ed225..9134114 100644 --- a/source/navigate.cpp +++ b/source/navigate.cpp @@ -1,4 +1,4 @@ -// +// // Yet Another POD-Bot, based on PODBot by Markus Klinge ("CountFloyd"). // Copyright (c) YaPB Development Team. // @@ -544,6 +544,7 @@ void Bot::CheckTerrain (float movedDistance, const Vector &dirNormal) state[i] = 0; i++; +#if 0 if (bits & PROBE_DUCK) { state[i] = 0; @@ -555,7 +556,8 @@ void Bot::CheckTerrain (float movedDistance, const Vector &dirNormal) state[i] += 5; } else - state[i] = 0; +#endif + state[i] = 0; i++; // weighted all possible moves, now sort them to start with most probable diff --git a/source/support.cpp b/source/support.cpp index 51d7a04..ef1b4b9 100644 --- a/source/support.cpp +++ b/source/support.cpp @@ -779,9 +779,6 @@ void SoundAttachToClients (edict_t *ent, const char *sample, float volume) } Client *client = &g_clients[index]; - if (client == NULL) - return; - if (strncmp ("player/bhit_flesh", sample, 17) == 0 || strncmp ("player/headshot", sample, 15) == 0) { // hit/fall sound?