fix: crash with lift handling
fix: some random crashes with some maps fix: do not look at breakable until totally sure we're can break it fix: wrong distance calculation in last enemy position randomizer fix: problems with cs 1.5 won when built with ``nosmid`` switch (still crashes from time to time) ctrl: add bots death count to``yb list`` command graph: disable buckets for small number of nodes graphs graph: verify graph consistency and select appropriate pathfinding algorithm misc: added mor vox sentences to welcome a player
This commit is contained in:
parent
01b176ad00
commit
3a014e471b
13 changed files with 172 additions and 71 deletions
|
|
@ -219,7 +219,7 @@ public:
|
|||
bool isNodeReacheableEx (const Vector &src, const Vector &destination, const float maxHeight);
|
||||
bool isNodeReacheable (const Vector &src, const Vector &destination);
|
||||
bool isNodeReacheableWithJump (const Vector &src, const Vector &destination);
|
||||
bool checkNodes (bool teleportPlayer);
|
||||
bool checkNodes (bool teleportPlayer, bool onlyPaths = false);
|
||||
bool isVisited (int index);
|
||||
bool isAnalyzed () const;
|
||||
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ public:
|
|||
};
|
||||
|
||||
// bot heuristic functions for astar planner
|
||||
class Heuristic final {
|
||||
class PlannerHeuristic final {
|
||||
public:
|
||||
using Func = float (*) (int, int, int);
|
||||
|
||||
|
|
@ -86,7 +86,7 @@ public:
|
|||
// A* algorithm for bots
|
||||
class AStarAlgo final : public NonCopyable {
|
||||
public:
|
||||
using HeuristicFn = Heuristic::Func;
|
||||
using HeuristicFn = PlannerHeuristic::Func;
|
||||
|
||||
public:
|
||||
struct Route {
|
||||
|
|
@ -246,6 +246,7 @@ private:
|
|||
UniquePtr <DijkstraAlgo> m_dijkstra {};
|
||||
UniquePtr <FloydWarshallAlgo> m_floyd {};
|
||||
bool m_memoryLimitHit {};
|
||||
bool m_pathsCheckFailed {};
|
||||
|
||||
public:
|
||||
PathPlanner ();
|
||||
|
|
@ -269,6 +270,11 @@ public:
|
|||
return m_floyd.get ();
|
||||
}
|
||||
|
||||
public:
|
||||
bool isPathsCheckFailed () const {
|
||||
return m_pathsCheckFailed;
|
||||
}
|
||||
|
||||
public:
|
||||
// do the pathfinding
|
||||
bool find (int srcIndex, int destIndex, NodeAdderFn onAddedNode, int *pathDistance = nullptr);
|
||||
|
|
|
|||
|
|
@ -662,6 +662,7 @@ public:
|
|||
int m_weaponType {}; // current weapon type
|
||||
int m_ammoInClip[kMaxWeapons] {}; // ammo in clip for each weapons
|
||||
int m_ammo[MAX_AMMO_SLOTS] {}; // total ammo amounts
|
||||
int m_deathCount {}; // number of bot deaths
|
||||
|
||||
bool m_isVIP {}; // bot is vip?
|
||||
bool m_isAlive {}; // has the player been killed or has he just respawned
|
||||
|
|
@ -819,6 +820,11 @@ public:
|
|||
// execute client command helper
|
||||
template <typename ...Args> void issueCommand (const char *fmt, Args &&...args);
|
||||
|
||||
// checks if valid prediction index
|
||||
bool isNodeValidForPredict (const int index) const {
|
||||
return BotGraph::instance ().exists (index) && index != m_currentNodeIndex;
|
||||
}
|
||||
|
||||
private:
|
||||
// returns true if bot is using a sniper rifle
|
||||
bool usesSniper () const {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue