bot: switch look/body angles updates to thread worker
build: msvc projects now again targets msvc by default
This commit is contained in:
parent
52bfac2b09
commit
5ce2032acd
8 changed files with 59 additions and 35 deletions
|
|
@ -416,23 +416,23 @@ CR_DECLARE_SCOPED_ENUM (FrustumSide,
|
|||
)
|
||||
|
||||
// some hard-coded desire defines used to override calculated ones
|
||||
struct TaskPri {
|
||||
static constexpr auto Normal { 35.0f };
|
||||
static constexpr auto Pause { 36.0f };
|
||||
static constexpr auto Camp { 37.0f };
|
||||
static constexpr auto Spraypaint { 38.0f };
|
||||
static constexpr auto FollowUser { 39.0f };
|
||||
static constexpr auto MoveToPosition { 50.0f };
|
||||
static constexpr auto DefuseBomb { 89.0f };
|
||||
static constexpr auto PlantBomb { 89.0f };
|
||||
static constexpr auto Attack { 90.0f };
|
||||
static constexpr auto SeekCover { 91.0f };
|
||||
static constexpr auto Hide { 92.0f };
|
||||
static constexpr auto Throw { 99.0f };
|
||||
static constexpr auto DoubleJump { 99.0f };
|
||||
static constexpr auto Blind { 100.0f };
|
||||
static constexpr auto ShootBreakable { 100.0f };
|
||||
static constexpr auto EscapeFromBomb { 100.0f };
|
||||
namespace TaskPri {
|
||||
constexpr auto Normal { 35.0f };
|
||||
constexpr auto Pause { 36.0f };
|
||||
constexpr auto Camp { 37.0f };
|
||||
constexpr auto Spraypaint { 38.0f };
|
||||
constexpr auto FollowUser { 39.0f };
|
||||
constexpr auto MoveToPosition { 50.0f };
|
||||
constexpr auto DefuseBomb { 89.0f };
|
||||
constexpr auto PlantBomb { 89.0f };
|
||||
constexpr auto Attack { 90.0f };
|
||||
constexpr auto SeekCover { 91.0f };
|
||||
constexpr auto Hide { 92.0f };
|
||||
constexpr auto Throw { 99.0f };
|
||||
constexpr auto DoubleJump { 99.0f };
|
||||
constexpr auto Blind { 100.0f };
|
||||
constexpr auto ShootBreakable { 100.0f };
|
||||
constexpr auto EscapeFromBomb { 100.0f };
|
||||
};
|
||||
|
||||
constexpr auto kInfiniteDistance = 9999999.0f;
|
||||
|
|
@ -441,6 +441,7 @@ constexpr auto kGrenadeCheckTime = 0.6f;
|
|||
constexpr auto kSprayDistance = 260.0f;
|
||||
constexpr auto kDoubleSprayDistance = kSprayDistance * 2;
|
||||
constexpr auto kMaxChatterRepeatInterval = 99.0f;
|
||||
constexpr auto kViewFrameUpdate = 1.0f / 30.0f;
|
||||
|
||||
constexpr auto kInfiniteDistanceLong = static_cast <int> (kInfiniteDistance);
|
||||
constexpr auto kMaxWeapons = 32;
|
||||
|
|
|
|||
|
|
@ -225,6 +225,7 @@ public:
|
|||
private:
|
||||
mutable Mutex m_pathFindLock {};
|
||||
mutable Mutex m_predictLock {};
|
||||
mutable Mutex m_lookAnglesLock {};
|
||||
|
||||
private:
|
||||
uint32_t m_states {}; // sensing bitstates
|
||||
|
|
@ -471,6 +472,7 @@ private:
|
|||
void checkBurstMode (float distance);
|
||||
void checkSilencer ();
|
||||
void updateAimDir ();
|
||||
void syncUpdateLookAngles ();
|
||||
void updateLookAngles ();
|
||||
void updateBodyAngles ();
|
||||
void updateLookAnglesNewbie (const Vector &direction, float delta);
|
||||
|
|
@ -701,7 +703,8 @@ public:
|
|||
|
||||
// need to wait until all threads will finish it's work before terminating bot object
|
||||
~Bot () {
|
||||
MutexScopedLock lock (m_pathFindLock);
|
||||
MutexScopedLock lock1 (m_pathFindLock);
|
||||
MutexScopedLock lock2 (m_lookAnglesLock);
|
||||
}
|
||||
|
||||
public:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue