fix: breakable headache (ref #660)
fix: bots firing rates on short distances (ref #658)
This commit is contained in:
parent
e717710bd1
commit
c07d02c14e
9 changed files with 157 additions and 53 deletions
10
inc/engine.h
10
inc/engine.h
|
|
@ -164,6 +164,8 @@ private:
|
|||
edict_t *m_localEntity {};
|
||||
|
||||
Array <edict_t *> m_breakables {};
|
||||
HashMap <int32_t, bool> m_checkedBreakables {};
|
||||
|
||||
SmallArray <ConVarReg> m_cvars {};
|
||||
SharedLibrary m_gameLib {};
|
||||
SharedLibrary m_engineLib {};
|
||||
|
|
@ -269,6 +271,9 @@ public:
|
|||
// creates a fake client's a nd resets all the entvars
|
||||
edict_t *createFakeClient (StringRef name);
|
||||
|
||||
// mark breakable entity as invalid
|
||||
void markBreakableAsInvalid (edict_t *ent);
|
||||
|
||||
// public inlines
|
||||
public:
|
||||
// get the current time on server
|
||||
|
|
@ -424,6 +429,11 @@ public:
|
|||
return !m_breakables.empty ();
|
||||
}
|
||||
|
||||
// is breakable entity is valid ?
|
||||
bool isBreakableValid (edict_t *ent) {
|
||||
return m_checkedBreakables[indexOfEntity (ent)];
|
||||
}
|
||||
|
||||
// find variable value by variable name
|
||||
StringRef findCvar (StringRef name) {
|
||||
return engfuncs.pfnCVarGetString (name.chars ());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue