fix: bad maxspeed after respawn with csdm (ref #482)

fix: free for all mode has no friends or foes
chat: disable dead chat on csdm
This commit is contained in:
jeefo 2023-09-14 16:48:36 +03:00
commit 948b441541
No known key found for this signature in database
GPG key ID: 927BCA0779BEA8ED
11 changed files with 119 additions and 64 deletions

View file

@ -398,6 +398,39 @@ public:
}
};
// reference some game/mod cvars for access
class ConVarRef final : public NonCopyable {
private:
cvar_t *ptr_ {};
String name_ {};
bool checked_ {};
public:
ConVarRef (StringRef name) : name_ (name) {}
~ConVarRef () = default;
public:
bool exists () {
if (checked_ && !ptr_) {
return false;
}
checked_ = true;
ptr_ = engfuncs.pfnCVarGetPointer (name_.chars ());
return ptr_ != nullptr;
}
template <typename U = float> U value () {
return exists () ? static_cast <U> (ptr_->value) : static_cast <U> (0);
}
void set (StringRef value) {
if (exists ()) {
engfuncs.pfnCvar_DirectSet (ptr_, value.chars ());
}
}
};
// simplify access for console variables
class ConVar final : public NonCopyable {
public:

View file

@ -655,7 +655,7 @@ public:
int m_ammo[MAX_AMMO_SLOTS] {}; // total ammo amounts
bool m_isVIP {}; // bot is vip?
bool m_notKilled {}; // has the player been killed or has he just respawned
bool m_isAlive {}; // has the player been killed or has he just respawned
bool m_notStarted {}; // team/class not chosen yet
bool m_ignoreBuyDelay {}; // when reaching buyzone in the middle of the round don't do pauses
bool m_inBombZone {}; // bot in the bomb zone or not