diff --git a/src/shared/NSClient.h b/src/shared/NSClient.h index 47c241cd..34f68100 100644 --- a/src/shared/NSClient.h +++ b/src/shared/NSClient.h @@ -71,6 +71,11 @@ public: /** Get the string value of an InfoKey. */ nonvirtual string GetInfoKey(string); + /** Floating point based version of SetInfoKey(). */ + nonvirtual void SetInfoKeyFloat(string, float); + /** Floating point based version of GetInfoKey(). */ + nonvirtual float GetInfoKeyFloat(string); + /* overrides */ virtual void Save(float); virtual void Restore(string,string); diff --git a/src/shared/NSClient.qc b/src/shared/NSClient.qc index 2365eb93..9b6de012 100644 --- a/src/shared/NSClient.qc +++ b/src/shared/NSClient.qc @@ -75,6 +75,18 @@ NSClient::GetInfoKey(string strKey) return infokey(this, strKey); } +void +NSClient::SetInfoKeyFloat(string strKey, float floatValue) +{ + forceinfokey(this, strKey, ftos(floatValue)); +} + +float +NSClient::GetInfoKeyFloat(string strKey) +{ + return infokeyf(this, strKey); +} + #endif void