nav: minor change in ladder use.

aim: slight improvement in enemy prediction node recruitment.
This commit is contained in:
commandcobra7 2024-11-13 17:52:19 +03:00 committed by jeefo
commit 1d60f19402
16 changed files with 151 additions and 145 deletions

View file

@ -9,9 +9,9 @@
// links keywords and replies together
struct ChatKeywords {
StringArray keywords;
StringArray replies;
StringArray usedReplies;
StringArray keywords {};
StringArray replies {};
StringArray usedReplies {};
public:
ChatKeywords () = default;

View file

@ -9,7 +9,7 @@
// botname structure definition
struct BotName {
String name;
String name {};
int usedBy = -1;
public:
@ -19,9 +19,9 @@ public:
// voice config structure definition
struct ChatterItem {
String name;
float repeat;
float duration;
String name {};
float repeat {};
float duration {};
public:
ChatterItem (StringRef name, float repeat, float duration) : name (name), repeat (repeat), duration (duration) {}

View file

@ -29,7 +29,7 @@ public:
public:
// generic bot command
struct BotCmd {
String name, format, help;
String name {}, format {}, help {};
Handler handler = nullptr;
bool visible = true;
@ -42,9 +42,9 @@ public:
// single bot menu
struct BotMenu {
int ident, slots;
String text;
MenuHandler handler;
int ident {}, slots {};
String text {};
MenuHandler handler {};
public:
explicit BotMenu (int ident, int slots, StringRef text, MenuHandler handler) : ident (ident), slots (slots), text (text), handler (cr::move (handler))
@ -54,7 +54,7 @@ public:
// queued text message to prevent overflow with rapid output
struct PrintQueue {
int32_t destination {};
String text;
String text {};
public:
explicit PrintQueue () = default;
@ -68,7 +68,7 @@ public:
float timelimit {};
float freezetime {};
float roundtime {};
} m_graphSaveVarValues;
} m_graphSaveVarValues {};
private:
StringArray m_args {};

View file

@ -85,16 +85,16 @@ CR_DECLARE_SCOPED_ENUM (PlayerPart,
// variable reg pair
struct ConVarReg {
cvar_t reg;
String info;
String init;
String regval;
String name;
class ConVar *self;
float initial, min, max;
bool missing;
bool bounded;
int32_t type;
cvar_t reg {};
String info {};
String init {};
String regval {};
String name {};
class ConVar *self {};
float initial {}, min {}, max {};
bool missing {};
bool bounded {};
int32_t type {};
};
// entity prototype

View file

@ -91,11 +91,11 @@ CR_DECLARE_SCOPED_ENUM (NotifySound,
// general waypoint header information structure for podbot
struct PODGraphHeader {
char header[8];
int32_t fileVersion;
int32_t pointNumber;
char mapName[32];
char author[32];
char header[8] {};
int32_t fileVersion {};
int32_t pointNumber {};
char mapName[32] {};
char author[32] {};
};
// defines linked nodes
@ -117,31 +117,31 @@ struct Path {
// define waypoint structure for podbot (will convert on load)
struct PODPath {
int32_t number, flags;
Vector origin;
float radius, csx, csy, cex, cey;
int16_t index[kMaxNodeLinks];
uint16_t conflags[kMaxNodeLinks];
Vector velocity[kMaxNodeLinks];
int32_t distance[kMaxNodeLinks];
PathVis vis;
int32_t number {}, flags {};
Vector origin {};
float radius {}, csx {}, csy {}, cex {}, cey {};
int16_t index[kMaxNodeLinks] {};
uint16_t conflags[kMaxNodeLinks] {};
Vector velocity[kMaxNodeLinks] {};
int32_t distance[kMaxNodeLinks] {};
PathVis vis {};
};
// general storage header information structure
struct StorageHeader {
int32_t magic;
int32_t version;
int32_t options;
int32_t length;
int32_t compressed;
int32_t uncompressed;
int32_t magic {};
int32_t version {};
int32_t options {};
int32_t length {};
int32_t compressed {};
int32_t uncompressed {};
};
// extension header for graph information
struct ExtenHeader {
char author[32]; // original author of graph
int32_t mapSize; // bsp size for checksumming map consistency
char modified[32]; // by whom modified
char author[32] {}; // original author of graph
int32_t mapSize {}; // bsp size for checksumming map consistency
char modified[32] {}; // by whom modified
};
// graph operation class

View file

@ -87,7 +87,7 @@ private:
using SendToProto = decltype (sendto);
private:
Detour <SendToProto> m_sendToDetour { }, m_sendToDetourSys {};
Detour <SendToProto> m_sendToDetour {}, m_sendToDetourSys {};
public:
ServerQueryHook () = default;
@ -126,11 +126,11 @@ private:
private:
bool m_paused { false };
Detour <DlsymProto> m_dlsym;
Detour <DlcloseProto> m_dlclose;
HashMap <StringRef, SharedLibrary::Func> m_exports;
Detour <DlsymProto> m_dlsym {};
Detour <DlcloseProto> m_dlclose {};
HashMap <StringRef, SharedLibrary::Func> m_exports {};
SharedLibrary m_self;
SharedLibrary m_self {};
public:
DynamicLinkerHook () = default;

View file

@ -9,12 +9,12 @@
// bot creation tab
struct BotRequest {
bool manual;
int difficulty;
int team;
int skin;
int personality;
String name;
bool manual {};
int difficulty {};
int team {};
int skin {};
int personality {};
String name {};
};
// manager class

View file

@ -104,8 +104,8 @@ private:
int m_length {};
Array <int> m_constructedPath;
Array <int> m_smoothedPath;
Array <int> m_constructedPath {};
Array <int> m_smoothedPath {};
private:
// clears the currently built route

View file

@ -36,10 +36,10 @@ public:
static constexpr float kMinViewDistance = 2.0f;
private:
float m_farHeight; // height of the far frustum
float m_farWidth; // width of the far frustum
float m_nearHeight; // height of the near frustum
float m_nearWidth; // width of the near frustum
float m_farHeight {}; // height of the far frustum
float m_farWidth {}; // width of the far frustum
float m_nearHeight {}; // height of the near frustum
float m_nearWidth {}; // width of the near frustum
public:
explicit Frustum () {

View file

@ -17,7 +17,7 @@ CR_DECLARE_SCOPED_ENUM_TYPE (VisIndex, int32_t,
// defines visibility count
struct PathVis {
uint16_t stand, crouch;
uint16_t stand {}, crouch {};
};
class GraphVistable final : public Singleton <GraphVistable> {

View file

@ -26,12 +26,12 @@ struct BotTask {
using Function = void (Bot::*) ();
public:
Function func; // corresponding exec function in bot class
Task id; // major task/action carried out
float desire; // desire (filled in) for this task
int data; // additional data (node index)
float time; // time task expires
bool resume; // if task can be continued if interrupted
Function func {}; // corresponding exec function in bot class
Task id {}; // major task/action carried out
float desire {}; // desire (filled in) for this task
int data {}; // additional data (node index)
float time {}; // time task expires
bool resume {}; // if task can be continued if interrupted
public:
BotTask (Function func, Task id, float desire, int data, float time, bool resume) : func (func), id (id), desire (desire), data (data), time (time), resume (resume) { }
@ -50,21 +50,21 @@ struct WeaponProp {
// weapon info structure
struct WeaponInfo {
int id; // the weapon id value
StringRef name; // name of the weapon when selecting it
StringRef model; // model name to separate cs weapons
int price; // price when buying
int minPrimaryAmmo; // minimum primary ammo
int teamStandard; // used by team (number) (standard map)
int teamAS; // used by team (as map)
int buyGroup; // group in buy menu (standard map)
int buySelect; // select item in buy menu (standard map)
int buySelectT; // for counter-strike v1.6
int buySelectCT; // for counter-strike v1.6
int penetratePower; // penetrate power
int maxClip; // max ammo in clip
int type; // weapon class
bool primaryFireHold; // hold down primary fire button to use?
int id {}; // the weapon id value
StringRef name {}; // name of the weapon when selecting it
StringRef model {}; // model name to separate cs weapons
int price {}; // price when buying
int minPrimaryAmmo {}; // minimum primary ammo
int teamStandard {}; // used by team (number) (standard map)
int teamAS {}; // used by team (as map)
int buyGroup {}; // group in buy menu (standard map)
int buySelect {}; // select item in buy menu (standard map)
int buySelectT {}; // for counter-strike v1.6
int buySelectCT {}; // for counter-strike v1.6
int penetratePower {}; // penetrate power
int maxClip {}; // max ammo in clip
int type {}; // weapon class
bool primaryFireHold {}; // hold down primary fire button to use?
public:
WeaponInfo (int id,
@ -227,7 +227,7 @@ private:
int m_radioSelect {}; // radio entry
int m_killsCount {}; // the kills count of a bot
int m_lastPredictIndex { kInvalidNodeIndex }; // last predicted path index
int m_lastPredictIndex {}; // last predicted path index
int m_lastPredictLength {}; // last predicted path length
int m_pickupType {}; // type of entity which needs to be used/picked up
@ -452,7 +452,7 @@ private:
bool isEnemyInSight (Vector &endPos);
bool isEnemyNoticeable (float range);
bool isCreature ();
bool isOnLadderPath ();
bool isPreviousLadder ();
bool isIgnoredItem (edict_t *ent);
void doPlayerAvoidance (const Vector &normal);