fixed xash3d engine compat
removed some paranoid check in bomb defusing
This commit is contained in:
parent
dd7b85dea7
commit
afd29925e2
2 changed files with 13 additions and 31 deletions
|
|
@ -1,4 +1,4 @@
|
||||||
//
|
//
|
||||||
// Yet Another POD-Bot, based on PODBot by Markus Klinge ("CountFloyd").
|
// Yet Another POD-Bot, based on PODBot by Markus Klinge ("CountFloyd").
|
||||||
// Copyright (c) YaPB Development Team.
|
// Copyright (c) YaPB Development Team.
|
||||||
//
|
//
|
||||||
|
|
@ -3747,7 +3747,7 @@ void Bot::RunTask_PlantBomb (void)
|
||||||
|
|
||||||
void Bot::RunTask_DefuseBomb (void)
|
void Bot::RunTask_DefuseBomb (void)
|
||||||
{
|
{
|
||||||
float fullDefuseTime = m_hasDefuser ? 6.0f : 11.0f;
|
float fullDefuseTime = m_hasDefuser ? 7.0f : 12.0f;
|
||||||
float timeToBlowUp = GetBombTimeleft ();
|
float timeToBlowUp = GetBombTimeleft ();
|
||||||
float defuseRemainingTime = fullDefuseTime;
|
float defuseRemainingTime = fullDefuseTime;
|
||||||
|
|
||||||
|
|
@ -3777,32 +3777,19 @@ void Bot::RunTask_DefuseBomb (void)
|
||||||
}
|
}
|
||||||
else if (defuseRemainingTime > timeToBlowUp) // exception: not time left for defusing
|
else if (defuseRemainingTime > timeToBlowUp) // exception: not time left for defusing
|
||||||
defuseError = true;
|
defuseError = true;
|
||||||
else if (m_states & STATE_SEEING_ENEMY) // exception: saw/seeing enemy
|
else if (IsValidPlayer (m_enemy))
|
||||||
{
|
{
|
||||||
if (GetNearbyFriendsNearPosition (pev->origin, 128.0f) == 0)
|
int friends = GetNearbyFriendsNearPosition (pev->origin, 768.0f);
|
||||||
{
|
|
||||||
if (defuseRemainingTime > 0.75f)
|
|
||||||
{
|
|
||||||
if (GetNearbyFriendsNearPosition (pev->origin, 512.0f) > 0)
|
|
||||||
RadioMessage (Radio_NeedBackup);
|
|
||||||
|
|
||||||
defuseError = true;
|
if (friends < 2 && defuseRemainingTime < timeToBlowUp)
|
||||||
}
|
{
|
||||||
}
|
|
||||||
else if (timeToBlowUp > fullDefuseTime + 3.0f && defuseRemainingTime > 1.0f)
|
|
||||||
defuseError = true;
|
defuseError = true;
|
||||||
}
|
|
||||||
else if (m_states & STATE_SUSPECT_ENEMY) // exception: suspect enemy
|
|
||||||
{
|
|
||||||
if (GetNearbyFriendsNearPosition (pev->origin, 128.0f) == 0)
|
|
||||||
{
|
|
||||||
if (timeToBlowUp > fullDefuseTime + 10.0f)
|
|
||||||
{
|
|
||||||
if (GetNearbyFriendsNearPosition (pev->origin, 512.0f) > 0)
|
|
||||||
RadioMessage (Radio_NeedBackup);
|
|
||||||
|
|
||||||
defuseError = true;
|
if (defuseRemainingTime + 2.0f > timeToBlowUp)
|
||||||
}
|
defuseError = false;
|
||||||
|
|
||||||
|
if (m_numFriendsLeft > friends)
|
||||||
|
RadioMessage (Radio_NeedBackup);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -5696,12 +5683,7 @@ byte Bot::ThrottledMsec (void)
|
||||||
{
|
{
|
||||||
// estimate msec to use for this command based on time passed from the previous command
|
// estimate msec to use for this command based on time passed from the previous command
|
||||||
|
|
||||||
byte adjustedMsec = static_cast <byte> ((GetWorldTime () - m_lastCommandTime) * 1000.0f);
|
return static_cast <byte> ((GetWorldTime () - m_lastCommandTime) * 1000.0f);
|
||||||
|
|
||||||
if (adjustedMsec > 255)
|
|
||||||
adjustedMsec = 255;
|
|
||||||
|
|
||||||
return adjustedMsec;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Bot::RunPlayerMovement (void)
|
void Bot::RunPlayerMovement (void)
|
||||||
|
|
|
||||||
|
|
@ -1151,7 +1151,7 @@ void Bot::NewRound (void)
|
||||||
if (Random.Long (0, 100) < 50)
|
if (Random.Long (0, 100) < 50)
|
||||||
ChatterMessage (Chatter_NewRound);
|
ChatterMessage (Chatter_NewRound);
|
||||||
|
|
||||||
m_thinkInterval = (1.0f / 30.0f) * Random.Float (0.95f, 1.05f);
|
m_thinkInterval = g_gameVersion == CSV_OLD ? 0.0f : (1.0f / 30.0f) * Random.Float (0.95f, 1.05f);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Bot::Kill (void)
|
void Bot::Kill (void)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue