fixed some clang warnings
remove chat string from code
This commit is contained in:
parent
1b1ae9ea91
commit
25504279d9
10 changed files with 25 additions and 27 deletions
|
|
@ -156,7 +156,7 @@ public:
|
||||||
m_codeSize = 0;
|
m_codeSize = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int InternalEncode (char *fileName, byte *header, int headerSize, byte *buffer, int bufferSize)
|
int InternalEncode (const char *fileName, byte *header, int headerSize, byte *buffer, int bufferSize)
|
||||||
{
|
{
|
||||||
int i, bit, length, node, strPtr, lastMatchLength, codeBufferPtr, bufferPtr = 0;
|
int i, bit, length, node, strPtr, lastMatchLength, codeBufferPtr, bufferPtr = 0;
|
||||||
byte codeBuffer[17], mask;
|
byte codeBuffer[17], mask;
|
||||||
|
|
@ -257,7 +257,7 @@ public:
|
||||||
return m_codeSize;
|
return m_codeSize;
|
||||||
}
|
}
|
||||||
|
|
||||||
int InternalDecode (char *fileName, int headerSize, byte *buffer, int bufferSize)
|
int InternalDecode (const char *fileName, int headerSize, byte *buffer, int bufferSize)
|
||||||
{
|
{
|
||||||
int i, j, k, node, bit;
|
int i, j, k, node, bit;
|
||||||
unsigned int flags;
|
unsigned int flags;
|
||||||
|
|
@ -327,14 +327,14 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
// external decoder
|
// external decoder
|
||||||
static int Uncompress (char *fileName, int headerSize, byte *buffer, int bufferSize)
|
static int Uncompress (const char *fileName, int headerSize, byte *buffer, int bufferSize)
|
||||||
{
|
{
|
||||||
static Compressor compressor = Compressor ();
|
static Compressor compressor = Compressor ();
|
||||||
return compressor.InternalDecode (fileName, headerSize, buffer, bufferSize);
|
return compressor.InternalDecode (fileName, headerSize, buffer, bufferSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
// external encoder
|
// external encoder
|
||||||
static int Compress(char *fileName, byte *header, int headerSize, byte *buffer, int bufferSize)
|
static int Compress(const char *fileName, byte *header, int headerSize, byte *buffer, int bufferSize)
|
||||||
{
|
{
|
||||||
static Compressor compressor = Compressor ();
|
static Compressor compressor = Compressor ();
|
||||||
return compressor.InternalEncode (fileName, header, headerSize, buffer, bufferSize);
|
return compressor.InternalEncode (fileName, header, headerSize, buffer, bufferSize);
|
||||||
|
|
|
||||||
|
|
@ -1596,7 +1596,7 @@ extern int GetTeam (edict_t *ent);
|
||||||
extern float GetShootingConeDeviation (edict_t *ent, Vector *position);
|
extern float GetShootingConeDeviation (edict_t *ent, Vector *position);
|
||||||
extern float GetWaveLength (const char *fileName);
|
extern float GetWaveLength (const char *fileName);
|
||||||
|
|
||||||
extern bool TryFileOpen (char *fileName);
|
extern bool TryFileOpen (const char *fileName);
|
||||||
extern bool IsDedicatedServer (void);
|
extern bool IsDedicatedServer (void);
|
||||||
extern bool IsVisible (const Vector &origin, edict_t *ent);
|
extern bool IsVisible (const Vector &origin, edict_t *ent);
|
||||||
extern bool IsAlive (edict_t *ent);
|
extern bool IsAlive (edict_t *ent);
|
||||||
|
|
@ -1611,7 +1611,7 @@ extern const char *GetMapName (void);
|
||||||
extern const char *GetWaypointDir (void);
|
extern const char *GetWaypointDir (void);
|
||||||
extern const char *GetModName (void);
|
extern const char *GetModName (void);
|
||||||
extern const char *GetField (const char *string, int fieldId, bool endLine = false);
|
extern const char *GetField (const char *string, int fieldId, bool endLine = false);
|
||||||
extern char *FormatBuffer (char *format, ...);
|
extern const char *FormatBuffer (const char *format, ...);
|
||||||
|
|
||||||
extern uint16 GenerateBuildNumber (void);
|
extern uint16 GenerateBuildNumber (void);
|
||||||
extern Vector GetEntityOrigin (edict_t *ent);
|
extern Vector GetEntityOrigin (edict_t *ent);
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,9 @@
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
|
||||||
|
#if defined (PLATFORM_WIN32)
|
||||||
#pragma warning (disable : 4100 4189 4239 4996 4244 383 473 981)
|
#pragma warning (disable : 4100 4189 4239 4996 4244 383 473 981)
|
||||||
|
#endif
|
||||||
|
|
||||||
//
|
//
|
||||||
// Title: Utility Classes Header
|
// Title: Utility Classes Header
|
||||||
|
|
|
||||||
|
|
@ -75,7 +75,9 @@ typedef int BOOL;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// In case this ever changes
|
// In case this ever changes
|
||||||
|
#ifndef M_PI
|
||||||
#define M_PI 3.1415926
|
#define M_PI 3.1415926
|
||||||
|
#endif
|
||||||
|
|
||||||
//
|
//
|
||||||
// Conversion among the three types of "entity", including identity-conversions.
|
// Conversion among the three types of "entity", including identity-conversions.
|
||||||
|
|
|
||||||
|
|
@ -54,12 +54,12 @@
|
||||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||||
<PlatformToolset>v140_xp</PlatformToolset>
|
<PlatformToolset>v120_xp</PlatformToolset>
|
||||||
<UseOfMfc>false</UseOfMfc>
|
<UseOfMfc>false</UseOfMfc>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||||
<PlatformToolset>v140_xp</PlatformToolset>
|
<PlatformToolset>v120_xp</PlatformToolset>
|
||||||
<UseOfMfc>false</UseOfMfc>
|
<UseOfMfc>false</UseOfMfc>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||||
|
|
|
||||||
|
|
@ -1858,7 +1858,7 @@ void Bot::SetConditions (void)
|
||||||
float distance = (m_lastEnemy->v.origin - pev->origin).GetLength ();
|
float distance = (m_lastEnemy->v.origin - pev->origin).GetLength ();
|
||||||
|
|
||||||
// is enemy to high to throw
|
// is enemy to high to throw
|
||||||
if ((m_lastEnemy->v.origin.z > (pev->origin.z + 650.0)) || !(m_lastEnemy->v.flags & FL_ONGROUND | FL_DUCKING))
|
if ((m_lastEnemy->v.origin.z > (pev->origin.z + 650.0)) || !(m_lastEnemy->v.flags & (FL_ONGROUND | FL_DUCKING)))
|
||||||
distance = FLT_MAX; // just some crazy value
|
distance = FLT_MAX; // just some crazy value
|
||||||
|
|
||||||
// enemy is within a good throwing distance ?
|
// enemy is within a good throwing distance ?
|
||||||
|
|
@ -3094,8 +3094,6 @@ void Bot::Think (void)
|
||||||
|
|
||||||
killer->frags++;
|
killer->frags++;
|
||||||
MDLL_ClientKill (ENT (killer));
|
MDLL_ClientKill (ENT (killer));
|
||||||
|
|
||||||
HudMessage (ENT (killer), true, Vector (g_randGen.Long (33, 255), g_randGen.Long (33, 255), g_randGen.Long (33, 255)), "You was slayed, because of teamkilling a player. Please be careful.");
|
|
||||||
}
|
}
|
||||||
else if (m_voteMap != 0) // host wants the bots to vote for a map?
|
else if (m_voteMap != 0) // host wants the bots to vote for a map?
|
||||||
{
|
{
|
||||||
|
|
@ -4576,7 +4574,11 @@ void Bot::RunTask (void)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (m_pickupType == PICKUP_HOSTAGE)
|
||||||
|
destination = m_pickupItem->v.origin + pev->view_ofs;
|
||||||
|
else
|
||||||
destination = GetEntityOrigin (m_pickupItem);
|
destination = GetEntityOrigin (m_pickupItem);
|
||||||
|
|
||||||
m_destOrigin = destination;
|
m_destOrigin = destination;
|
||||||
m_entity = destination;
|
m_entity = destination;
|
||||||
|
|
||||||
|
|
@ -5580,15 +5582,11 @@ void Bot::DiscardWeaponForUser (edict_t *user, bool discardC4)
|
||||||
{
|
{
|
||||||
SelectWeaponByName ("weapon_c4");
|
SelectWeaponByName ("weapon_c4");
|
||||||
FakeClientCommand (GetEntity (), "drop");
|
FakeClientCommand (GetEntity (), "drop");
|
||||||
|
|
||||||
SayText (FormatBuffer ("Here! %s, and now go and setup it!", STRING (user->v.netname)));
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
SelectBestWeapon ();
|
SelectBestWeapon ();
|
||||||
FakeClientCommand (GetEntity (), "drop");
|
FakeClientCommand (GetEntity (), "drop");
|
||||||
|
|
||||||
SayText (FormatBuffer ("Here the weapon! %s, feel free to use it ;)", STRING (user->v.netname)));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
m_pickupItem = NULL;
|
m_pickupItem = NULL;
|
||||||
|
|
@ -5604,8 +5602,6 @@ void Bot::DiscardWeaponForUser (edict_t *user, bool discardC4)
|
||||||
m_nextBuyTime = GetWorldTime ();
|
m_nextBuyTime = GetWorldTime ();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
|
||||||
SayText (FormatBuffer ("Sorry %s, i don't want discard my %s to you!", STRING (user->v.netname), discardC4 ? "bomb" : "weapon"));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Bot::ResetDoubleJumpState (void)
|
void Bot::ResetDoubleJumpState (void)
|
||||||
|
|
@ -5954,7 +5950,7 @@ bool Bot::OutOfBombTimer (void)
|
||||||
if ((timeLeft < reachTime + 6 && !m_hasDefuser && !hasTeammatesWithDefuserKit) || (timeLeft < reachTime + 2 && m_hasDefuser))
|
if ((timeLeft < reachTime + 6 && !m_hasDefuser && !hasTeammatesWithDefuserKit) || (timeLeft < reachTime + 2 && m_hasDefuser))
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
if (m_hasProgressBar && IsOnFloor () && (m_hasDefuser ? 10.0 : 15.0 > GetBombTimeleft ()))
|
if (m_hasProgressBar && IsOnFloor () && ((m_hasDefuser ? 10.0 : 15.0) > GetBombTimeleft ()))
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
return false; // return false otherwise
|
return false; // return false otherwise
|
||||||
|
|
|
||||||
|
|
@ -492,9 +492,7 @@ bool Bot::DoFirePause (float distance, FireDelay *fireDelay)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
float offset = 0.0f;
|
float offset = 0.0f;
|
||||||
|
|
||||||
const float BurstDistance = 300.0f;
|
const float BurstDistance = 300.0f;
|
||||||
const float DoubleBurstDistance = BurstDistance * 2;
|
|
||||||
|
|
||||||
if (distance < BurstDistance) // KWo - 09.04.2010
|
if (distance < BurstDistance) // KWo - 09.04.2010
|
||||||
return false;
|
return false;
|
||||||
|
|
|
||||||
|
|
@ -3135,7 +3135,7 @@ DLL_GIVEFNPTRSTODLL GiveFnptrsToDll (enginefuncs_t *functionTable, globalvars_t
|
||||||
|
|
||||||
if (buffer)
|
if (buffer)
|
||||||
{
|
{
|
||||||
CreatePath (FormatBuffer ("%s/dlls", GetModName ()));
|
CreatePath (const_cast <char *> (FormatBuffer ("%s/dlls", GetModName ())));
|
||||||
File fp (gameDLLName, "wb");
|
File fp (gameDLLName, "wb");
|
||||||
|
|
||||||
if (fp.IsValid ())
|
if (fp.IsValid ())
|
||||||
|
|
|
||||||
|
|
@ -1145,7 +1145,7 @@ void Bot::Kill (void)
|
||||||
KeyValueData kv;
|
KeyValueData kv;
|
||||||
kv.szClassName = const_cast <char *> (g_weaponDefs[m_currentWeapon].className);
|
kv.szClassName = const_cast <char *> (g_weaponDefs[m_currentWeapon].className);
|
||||||
kv.szKeyName = "damagetype";
|
kv.szKeyName = "damagetype";
|
||||||
kv.szValue = FormatBuffer ("%d", (1 << 4));
|
kv.szValue = const_cast <char *> (FormatBuffer ("%d", (1 << 4)));
|
||||||
kv.fHandled = FALSE;
|
kv.fHandled = FALSE;
|
||||||
|
|
||||||
MDLL_KeyValue (hurtEntity, &kv);
|
MDLL_KeyValue (hurtEntity, &kv);
|
||||||
|
|
|
||||||
|
|
@ -83,7 +83,7 @@ short FixedSigned16 (float value, float scale)
|
||||||
return static_cast <short> (output);
|
return static_cast <short> (output);
|
||||||
}
|
}
|
||||||
|
|
||||||
char *FormatBuffer (char *format, ...)
|
const char *FormatBuffer (const char *format, ...)
|
||||||
{
|
{
|
||||||
va_list ap;
|
va_list ap;
|
||||||
static char staticBuffer[3072];
|
static char staticBuffer[3072];
|
||||||
|
|
@ -823,7 +823,7 @@ bool IsDedicatedServer (void)
|
||||||
return (IS_DEDICATED_SERVER () > 0); // ask engine for this
|
return (IS_DEDICATED_SERVER () > 0); // ask engine for this
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TryFileOpen (char *fileName)
|
bool TryFileOpen (const char *fileName)
|
||||||
{
|
{
|
||||||
// this function tests if a file exists by attempting to open it
|
// this function tests if a file exists by attempting to open it
|
||||||
|
|
||||||
|
|
@ -979,7 +979,7 @@ void ServerCommand (const char *format, ...)
|
||||||
vsprintf (string, format, ap);
|
vsprintf (string, format, ap);
|
||||||
va_end (ap);
|
va_end (ap);
|
||||||
|
|
||||||
SERVER_COMMAND (FormatBuffer ("%s\n", string)); // execute command
|
SERVER_COMMAND (const_cast <char *> (FormatBuffer ("%s\n", string))); // execute command
|
||||||
}
|
}
|
||||||
|
|
||||||
const char *GetMapName (void)
|
const char *GetMapName (void)
|
||||||
|
|
@ -1004,7 +1004,7 @@ bool OpenConfig (const char *fileName, char *errorIfNotExists, File *outFile, bo
|
||||||
if (strcmp (fileName, "lang.cfg") == 0 && strcmp (yb_language.GetString (), "en") == 0)
|
if (strcmp (fileName, "lang.cfg") == 0 && strcmp (yb_language.GetString (), "en") == 0)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
char *languageDependantConfigFile = FormatBuffer ("%s/addons/yapb/config/language/%s_%s", GetModName (), yb_language.GetString (), fileName);
|
const char *languageDependantConfigFile = FormatBuffer ("%s/addons/yapb/config/language/%s_%s", GetModName (), yb_language.GetString (), fileName);
|
||||||
|
|
||||||
// check is file is exists for this language
|
// check is file is exists for this language
|
||||||
if (TryFileOpen (languageDependantConfigFile))
|
if (TryFileOpen (languageDependantConfigFile))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue