control: add g path_clean to remove all links from node (#475)
refactor: small cosmetic changes
This commit is contained in:
parent
fe5c8ef053
commit
fb301b7b19
23 changed files with 205 additions and 132 deletions
|
|
@ -447,3 +447,8 @@ constexpr auto kSecondaryWeaponMask = (cr::bit (Weapon::P228) | cr::bit (Weapon:
|
|||
|
||||
// weapons < 7 are secondary
|
||||
constexpr auto kPrimaryWeaponMinIndex = 7;
|
||||
|
||||
// grenade model names
|
||||
static constexpr StringRef kExplosiveModelName = "hegrenade.mdl";
|
||||
static constexpr StringRef kFlashbangModelName = "flashbang.mdl";
|
||||
static constexpr StringRef kSmokeModelName = "smokegrenade.mdl";
|
||||
|
|
|
|||
|
|
@ -118,6 +118,7 @@ private:
|
|||
int cmdNodePathCreate ();
|
||||
int cmdNodePathDelete ();
|
||||
int cmdNodePathSetAutoDistance ();
|
||||
int cmdNodePathCleanAll ();
|
||||
int cmdNodeAcquireEditor ();
|
||||
int cmdNodeReleaseEditor ();
|
||||
int cmdNodeUpload ();
|
||||
|
|
|
|||
|
|
@ -111,7 +111,7 @@ public:
|
|||
// provides utility functions to not call original engine (less call-cost)
|
||||
class Game final : public Singleton <Game> {
|
||||
public:
|
||||
using EntitySearch = Lambda <EntitySearchResult (edict_t *)>;
|
||||
using EntitySearch = const Lambda <EntitySearchResult (edict_t *)> &;
|
||||
|
||||
private:
|
||||
int m_drawModels[DrawLine::Count] {};
|
||||
|
|
@ -227,12 +227,12 @@ public:
|
|||
}
|
||||
|
||||
// get "maxplayers" limit on server
|
||||
int maxClients () const {
|
||||
int maxClients () const {
|
||||
return globals->maxClients;
|
||||
}
|
||||
|
||||
// get the fakeclient command interface
|
||||
bool isBotCmd () const {
|
||||
bool isBotCmd () const {
|
||||
return !m_botArgs.empty ();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -239,6 +239,7 @@ public:
|
|||
void setRadius (int index, float radius);
|
||||
void pathCreate (char dir);
|
||||
void erasePath ();
|
||||
void resetPath (int index);
|
||||
void cachePoint (int index);
|
||||
void calculatePathRadius (int index);
|
||||
void addBasic ();
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ struct BotRequest {
|
|||
// manager class
|
||||
class BotManager final : public Singleton <BotManager> {
|
||||
public:
|
||||
using ForEachBot = Lambda <bool (Bot *)>;
|
||||
using ForEachBot = const Lambda <bool (Bot *)> &;
|
||||
using UniqueBot = UniquePtr <Bot>;
|
||||
|
||||
private:
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ CR_DECLARE_SCOPED_ENUM (AStarResult,
|
|||
)
|
||||
|
||||
// node added
|
||||
using NodeAdderFn = Lambda <bool (int)>;
|
||||
using NodeAdderFn = const Lambda <bool (int)> &;
|
||||
|
||||
// route twin node
|
||||
template <typename HT> struct RouteTwin final {
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ public:
|
|||
// check if entity is a hostage entity
|
||||
bool isHostageEntity (edict_t *ent);
|
||||
|
||||
// check if entity is a door enitty
|
||||
// check if entity is a door entity
|
||||
bool isDoorEntity (edict_t *ent);
|
||||
|
||||
// this function is checking that pointed by ent pointer obstacle, can be destroyed
|
||||
|
|
@ -133,13 +133,13 @@ public:
|
|||
}
|
||||
|
||||
// gets the shooting cone deviation
|
||||
float getShootingCone (edict_t *ent, const Vector &position) {
|
||||
return ent->v.v_angle.forward () | (position - (ent->v.origin + ent->v.view_ofs)).normalize (); // he's facing it, he meant it
|
||||
float getShootingCone (edict_t *ent, const Vector &pos) {
|
||||
return ent->v.v_angle.forward () | (pos - (ent->v.origin + ent->v.view_ofs)).normalize (); // he's facing it, he meant it
|
||||
}
|
||||
|
||||
// check if origin is inside view cone of entity
|
||||
bool isInViewCone (const Vector &origin, edict_t *ent) {
|
||||
return getShootingCone (ent, origin) >= cr::cosf (cr::deg2rad ((ent->v.fov > 0 ? ent->v.fov : 90.0f) * 0.5f));
|
||||
// check if position is inside view cone of entity
|
||||
bool isInViewCone (const Vector &pos, edict_t *ent) {
|
||||
return getShootingCone (ent, pos) >= cr::cosf (cr::deg2rad ((ent->v.fov > 0 ? ent->v.fov : 90.0f) * 0.5f));
|
||||
}
|
||||
|
||||
public:
|
||||
|
|
|
|||
|
|
@ -366,6 +366,7 @@ private:
|
|||
Vector m_lookAtPredict {}; // aiming vector when predicting
|
||||
Vector m_desiredVelocity {}; // desired velocity for jump nodes
|
||||
Vector m_breakableOrigin {}; // origin of breakable
|
||||
Vector m_rightRef {}; // right referential vector
|
||||
|
||||
Array <edict_t *> m_ignoredBreakable {}; // list of ignored breakables
|
||||
Array <edict_t *> m_hostages {}; // pointer to used hostage entities
|
||||
|
|
@ -485,7 +486,7 @@ private:
|
|||
void findShortestPath (int srcIndex, int destIndex);
|
||||
void findPath (int srcIndex, int destIndex, FindPath pathType = FindPath::Fast);
|
||||
void syncFindPath (int srcIndex, int destIndex, FindPath pathType);
|
||||
void debugMsgInternal (const char *str);
|
||||
void debugMsgInternal (StringRef str);
|
||||
void frame ();
|
||||
void resetCollision ();
|
||||
void ignoreCollision ();
|
||||
|
|
@ -509,6 +510,7 @@ private:
|
|||
void syncUpdatePredictedIndex ();
|
||||
void updatePredictedIndex ();
|
||||
void refreshModelName (char *infobuffer);
|
||||
void updateRightRef ();
|
||||
|
||||
void completeTask ();
|
||||
void executeTasks ();
|
||||
|
|
@ -540,9 +542,9 @@ private:
|
|||
void pickupItem_ ();
|
||||
void shootBreakable_ ();
|
||||
|
||||
edict_t *lookupButton (const char *target);
|
||||
edict_t *lookupButton (StringRef target);
|
||||
edict_t *lookupBreakable ();
|
||||
edict_t *setCorrectGrenadeVelocity (const char *model);
|
||||
edict_t *setCorrectGrenadeVelocity (StringRef model);
|
||||
|
||||
Vector getEnemyBodyOffset ();
|
||||
Vector calcThrow (const Vector &start, const Vector &stop);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue