backport: nodes flooder (analyzer) from cs-ebot
analyze: allow to disable goal marking analyze: add cvars descriptions and bounds nav: added optional post path smoothing for astar algorithm nav: now bots will use Dijkstra algo instead of floyd-warshall if memory usage too high (controlled via yb_path_floyd_memory_limit cvar) (fixes #434) nav: vistable are now calculated every frame to prevent game-freeze during loading the game (fixes #434) graph: pracrice reworked to hash table so memory footprint is as low as possible (at cost 5-10% performance loss on practice) (fixes #434) control: bots commands now is case-insensitive bot: major refactoring of bot's code nav: issue warnings about path fail only with debug practice: check for visibility when updating danger index analyzer: suspend any analyzing on change level control: add kickall_ct/kickall_t nav: increase blocked distance in stuck check
This commit is contained in:
parent
bb2e93a539
commit
e7712a551a
31 changed files with 3114 additions and 1722 deletions
17
inc/engine.h
17
inc/engine.h
|
|
@ -71,6 +71,7 @@ struct ConVarReg {
|
|||
String info;
|
||||
String init;
|
||||
String regval;
|
||||
String name;
|
||||
class ConVar *self;
|
||||
float initial, min, max;
|
||||
bool missing;
|
||||
|
|
@ -420,6 +421,19 @@ public:
|
|||
Game::instance ().addNewCvar (name, initval, info, bounded, min, max, type, regMissing, regVal, this);
|
||||
}
|
||||
|
||||
template <typename U> constexpr U get () const {
|
||||
if constexpr (cr::is_same <U, float>::value) {
|
||||
return ptr->value;
|
||||
}
|
||||
else if constexpr (cr::is_same <U, bool>::value) {
|
||||
return ptr->value > 0.0f;
|
||||
}
|
||||
else if constexpr (cr::is_same <U, int>::value) {
|
||||
return static_cast <int> (ptr->value);
|
||||
}
|
||||
assert ("!Inavlid type requeted.");
|
||||
}
|
||||
|
||||
bool bool_ () const {
|
||||
return ptr->value > 0.0f;
|
||||
}
|
||||
|
|
@ -447,6 +461,9 @@ public:
|
|||
void set (const char *val) {
|
||||
engfuncs.pfnCvar_DirectSet (ptr, val);
|
||||
}
|
||||
|
||||
// revet cvar to default value
|
||||
void revert ();
|
||||
};
|
||||
|
||||
class MessageWriter final {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue