fix: problems with breakable on cs_mari (ref #686)

fix: goal selection on some zombie  maps (ref #684)
This commit is contained in:
jeefo 2025-04-03 15:12:06 +03:00
commit d6d76e136d
No known key found for this signature in database
GPG key ID: D696786B81B667C8
12 changed files with 95 additions and 86 deletions

View file

@ -223,11 +223,11 @@ public:
bool isNodeReacheableWithJump (const Vector &src, const Vector &destination);
bool checkNodes (bool teleportPlayer, bool onlyPaths = false);
bool isVisited (int index);
bool isAnalyzed () const;
bool saveGraphData ();
bool loadGraphData ();
bool canDownload ();
bool isAnalyzed () const;
void saveOldFormat ();
void reset ();
@ -251,8 +251,7 @@ public:
void startLearnJump ();
void setVisited (int index);
void clearVisited ();
void initBuckets ();
void addToBucket (const Vector &pos, int index);
void eraseFromBucket (const Vector &pos, int index);
void setBombOrigin (bool reset = false, const Vector &pos = nullptr);
void unassignPath (int from, int to);
@ -267,7 +266,6 @@ public:
void collectOnline ();
IntArray getNearestInRadius (float radius, const Vector &origin, int maxCount = -1);
const IntArray &getNodesInBucket (const Vector &pos);
public:
StringRef getAuthor () const {
@ -353,6 +351,21 @@ public:
return m_nodeNumbers;
}
// reinitialize buckets
void initBuckets () {
m_hashTable.clear ();
}
// get the bucket of nodes near position
const IntArray &getNodesInBucket (const Vector &pos) {
return m_hashTable[locateBucket (pos)];
}
// add a node to position bucket
void addToBucket (const Vector &pos, int index) {
m_hashTable[locateBucket (pos)].emplace (index);
}
public:
// graph helper for sending message to correct channel
template <typename ...Args> void msg (const char *fmt, Args &&...args);