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
|
|
@ -1858,7 +1858,7 @@ void Bot::SetConditions (void)
|
|||
float distance = (m_lastEnemy->v.origin - pev->origin).GetLength ();
|
||||
|
||||
// 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
|
||||
|
||||
// enemy is within a good throwing distance ?
|
||||
|
|
@ -3094,8 +3094,6 @@ void Bot::Think (void)
|
|||
|
||||
killer->frags++;
|
||||
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?
|
||||
{
|
||||
|
|
@ -4576,7 +4574,11 @@ void Bot::RunTask (void)
|
|||
break;
|
||||
}
|
||||
|
||||
destination = GetEntityOrigin (m_pickupItem);
|
||||
if (m_pickupType == PICKUP_HOSTAGE)
|
||||
destination = m_pickupItem->v.origin + pev->view_ofs;
|
||||
else
|
||||
destination = GetEntityOrigin (m_pickupItem);
|
||||
|
||||
m_destOrigin = destination;
|
||||
m_entity = destination;
|
||||
|
||||
|
|
@ -5580,15 +5582,11 @@ void Bot::DiscardWeaponForUser (edict_t *user, bool discardC4)
|
|||
{
|
||||
SelectWeaponByName ("weapon_c4");
|
||||
FakeClientCommand (GetEntity (), "drop");
|
||||
|
||||
SayText (FormatBuffer ("Here! %s, and now go and setup it!", STRING (user->v.netname)));
|
||||
}
|
||||
else
|
||||
{
|
||||
SelectBestWeapon ();
|
||||
FakeClientCommand (GetEntity (), "drop");
|
||||
|
||||
SayText (FormatBuffer ("Here the weapon! %s, feel free to use it ;)", STRING (user->v.netname)));
|
||||
}
|
||||
|
||||
m_pickupItem = NULL;
|
||||
|
|
@ -5604,8 +5602,6 @@ void Bot::DiscardWeaponForUser (edict_t *user, bool discardC4)
|
|||
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)
|
||||
|
|
@ -5954,7 +5950,7 @@ bool Bot::OutOfBombTimer (void)
|
|||
if ((timeLeft < reachTime + 6 && !m_hasDefuser && !hasTeammatesWithDefuserKit) || (timeLeft < reachTime + 2 && m_hasDefuser))
|
||||
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 false; // return false otherwise
|
||||
|
|
|
|||
|
|
@ -492,9 +492,7 @@ bool Bot::DoFirePause (float distance, FireDelay *fireDelay)
|
|||
return true;
|
||||
|
||||
float offset = 0.0f;
|
||||
|
||||
const float BurstDistance = 300.0f;
|
||||
const float DoubleBurstDistance = BurstDistance * 2;
|
||||
|
||||
if (distance < BurstDistance) // KWo - 09.04.2010
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -3135,7 +3135,7 @@ DLL_GIVEFNPTRSTODLL GiveFnptrsToDll (enginefuncs_t *functionTable, globalvars_t
|
|||
|
||||
if (buffer)
|
||||
{
|
||||
CreatePath (FormatBuffer ("%s/dlls", GetModName ()));
|
||||
CreatePath (const_cast <char *> (FormatBuffer ("%s/dlls", GetModName ())));
|
||||
File fp (gameDLLName, "wb");
|
||||
|
||||
if (fp.IsValid ())
|
||||
|
|
|
|||
|
|
@ -1145,7 +1145,7 @@ void Bot::Kill (void)
|
|||
KeyValueData kv;
|
||||
kv.szClassName = const_cast <char *> (g_weaponDefs[m_currentWeapon].className);
|
||||
kv.szKeyName = "damagetype";
|
||||
kv.szValue = FormatBuffer ("%d", (1 << 4));
|
||||
kv.szValue = const_cast <char *> (FormatBuffer ("%d", (1 << 4)));
|
||||
kv.fHandled = FALSE;
|
||||
|
||||
MDLL_KeyValue (hurtEntity, &kv);
|
||||
|
|
|
|||
|
|
@ -83,7 +83,7 @@ short FixedSigned16 (float value, float scale)
|
|||
return static_cast <short> (output);
|
||||
}
|
||||
|
||||
char *FormatBuffer (char *format, ...)
|
||||
const char *FormatBuffer (const char *format, ...)
|
||||
{
|
||||
va_list ap;
|
||||
static char staticBuffer[3072];
|
||||
|
|
@ -823,7 +823,7 @@ bool IsDedicatedServer (void)
|
|||
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
|
||||
|
||||
|
|
@ -979,7 +979,7 @@ void ServerCommand (const char *format, ...)
|
|||
vsprintf (string, format, 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)
|
||||
|
|
@ -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)
|
||||
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
|
||||
if (TryFileOpen (languageDependantConfigFile))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue