re-added support for hl-1.1.0.4 & cs beta 6.6 minimum.

This commit is contained in:
jeefo 2016-09-14 15:40:42 +03:00
commit 37a352ac54
7 changed files with 55 additions and 28 deletions

View file

@ -66,6 +66,18 @@ static inline char *A_strdup (const char *str)
return strcpy (new char[strlen (str) + 1], str);
}
// From metamod-p
static inline bool A_IsValidCodePointer (const void *ptr)
{
#ifdef _WIN32
if (IsBadCodePtr (reinterpret_cast <FARPROC> (ptr)))
return false;
#endif
// do not check on linux
return true;
}
//
// Title: Utility Classes Header
//

View file

@ -68,8 +68,10 @@ struct VarPair
{
VarType type;
cvar_t reg;
bool regMissing;
class ConVar *self;
bool regMissing;
const char *regVal;
};
// translation pair
@ -167,7 +169,7 @@ public:
void IssueBotCommand (edict_t *ent, const char *fmt, ...);
// adds cvar to registration stack
void PushVariableToStack (const char *variable, const char *value, VarType varType, bool regMissing, ConVar *self);
void PushVariableToStack (const char *variable, const char *value, VarType varType, bool regMissing, const char *regVal, ConVar *self);
// sends local registration stack for engine registration
void PushRegisteredConVarsToEngine (bool gameVars = false);
@ -312,7 +314,7 @@ public:
cvar_t *m_eptr;
public:
ConVar (const char *name, const char *initval, VarType type = VT_NOSERVER, bool regMissing = false);
ConVar (const char *name, const char *initval, VarType type = VT_NOSERVER, bool regMissing = false, const char *regVal = nullptr);
FORCEINLINE bool GetBool (void) { return m_eptr->value > 0.0f; }
FORCEINLINE int GetInt (void) { return static_cast <int> (m_eptr->value); }