Update CS:GO team score gamedata.
3 * =============================================================================
5 * Copyright (C) 2004-2010 AlliedModders LLC. All rights reserved.
6 * =============================================================================
8 * This program is free software; you can redistribute it and/or modify it under
9 * the terms of the GNU General Public License, version 3.0, as published by the
10 * Free Software Foundation.
12 * This program is distributed in the hope that it will be useful, but WITHOUT
13 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
14 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
17 * You should have received a copy of the GNU General Public License along with
18 * this program. If not, see <http://www.gnu.org/licenses/>.
20 * As a special exception, AlliedModders LLC gives you permission to link the
21 * code of this program (as well as its derivative works) to "Half-Life 2," the
22 * "Source Engine," the "SourcePawn JIT," and any Game MODs that run on software
23 * by the Valve Corporation. You must obey the GNU General Public License in
24 * all respects for all other code used. Additionally, AlliedModders LLC grants
25 * this exception to all derivative works. AlliedModders LLC defines further
26 * exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007),
27 * or <http://www.sourcemod.net/license.php>.
32 #ifndef _INCLUDE_SOURCEMOD_COMPAT_WRAPPERS_H_
33 #define _INCLUDE_SOURCEMOD_COMPAT_WRAPPERS_H_
37 #if SOURCE_ENGINE >= SE_ORANGEBOX
38 #define CONVAR_REGISTER(object) ConVar_Register(0, object)
40 inline bool IsFlagSet(ConCommandBase *cmd, int flag)
42 return cmd->IsFlagSet(flag);
44 inline void InsertServerCommand(const char *buf)
46 engine->InsertServerCommand(buf);
48 inline ConCommandBase *FindCommandBase(const char *name)
50 return icvar->FindCommandBase(name);
52 inline ConCommand *FindCommand(const char *name)
54 return icvar->FindCommand(name);
60 inline const char *ArgS() const
62 return engine->Cmd_Args();
64 inline int ArgC() const
66 return engine->Cmd_Argc();
68 inline const char *Arg(int index) const
70 return engine->Cmd_Argv(index);
73 static int MaxCommandLength() { return 512; }
76 inline bool IsFlagSet(ConCommandBase *cmd, int flag)
78 return cmd->IsBitSet(flag);
80 inline void InsertServerCommand(const char *buf)
82 engine->InsertServerCommand(buf);
84 inline ConCommandBase *FindCommandBase(const char *name)
86 ConCommandBase *pBase = icvar->GetCommands();
89 if (strcmp(pBase->GetName(), name) == 0)
91 if (!pBase->IsCommand())
98 pBase = const_cast<ConCommandBase *>(pBase->GetNext());
102 inline ConCommand *FindCommand(const char *name)
104 ConCommandBase *pBase = icvar->GetCommands();
107 if (strcmp(pBase->GetName(), name) == 0)
109 if (!pBase->IsCommand())
114 return static_cast<ConCommand *>(pBase);
116 pBase = const_cast<ConCommandBase *>(pBase->GetNext());
121 #define CVAR_INTERFACE_VERSION VENGINE_CVAR_INTERFACE_VERSION
123 #define CONVAR_REGISTER(object) ConCommandBaseMgr::OneTimeInit(object)
124 typedef FnChangeCallback FnChangeCallback_t;
125 #endif //SOURCE_ENGINE >= SE_ORANGEBOX
127 #if SOURCE_ENGINE >= SE_LEFT4DEAD
128 inline int IndexOfEdict(const edict_t *pEdict)
130 return (int)(pEdict - gpGlobals->pEdicts);
132 inline edict_t *PEntityOfEntIndex(int iEntIndex)
134 if (iEntIndex >= 0 && iEntIndex < gpGlobals->maxEntities)
136 return (edict_t *)(gpGlobals->pEdicts + iEntIndex);
140 inline int GetTypeDescOffs(typedescription_t *td)
142 return td->fieldOffset;
145 inline int IndexOfEdict(const edict_t *pEdict)
147 return engine->IndexOfEdict(pEdict);
149 inline edict_t *PEntityOfEntIndex(int iEntIndex)
151 return engine->PEntityOfEntIndex(iEntIndex);
153 inline int GetTypeDescOffs(typedescription_t *td)
155 return td->fieldOffset[TD_OFFSET_NORMAL];
157 #endif //SOURCE_ENGINE >= SE_LEFT4DEAD
159 #if SOURCE_ENGINE == SE_DOTA
160 inline int GetPlayerUserId(edict_t *pEdict)
162 return engine->GetPlayerUserId(IndexOfEdict(pEdict) - 1);
165 inline int GetPlayerUserId(int client)
167 return engine->GetPlayerUserId(client - 1);
170 inline int GetPlayerUserId(edict_t *pEdict)
172 return engine->GetPlayerUserId(pEdict);
175 inline int GetPlayerUserId(int client)
177 return engine->GetPlayerUserId(PEntityOfEntIndex(client));
179 #endif //SOURCE_ENGINE >= SE_DOTA
181 #endif //_INCLUDE_SOURCEMOD_COMPAT_WRAPPERS_H_