Added preliminary support for Left 4 Dead; some things may not yet work.

This commit is contained in:
Scott Ehlert
2008-11-14 09:18:30 -06:00
parent 7e3f9ada31
commit ff7a2c6b73
74 changed files with 2285 additions and 421 deletions
+7 -7
View File
@@ -223,7 +223,7 @@ DataStatus EncodeValveParam(IPluginContext *pContext,
if (pEntity)
{
edict_t *pEdict = gameents->BaseEntityToEdict(pEntity);
*addr = engine->IndexOfEdict(pEdict);
*addr = IndexOfEdict(pEdict);
} else {
*addr = -1;
}
@@ -238,7 +238,7 @@ DataStatus EncodeValveParam(IPluginContext *pContext,
edict_t *pEdict = *(edict_t **)buffer;
if (pEdict)
{
*addr = engine->IndexOfEdict(pEdict);
*addr = IndexOfEdict(pEdict);
} else {
*addr = -1;
}
@@ -415,7 +415,7 @@ DataStatus DecodeValveParam(IPluginContext *pContext,
} else if (param == 0) {
if (data->decflags & VDECODE_FLAG_ALLOWWORLD)
{
pEdict = engine->PEntityOfEntIndex(0);
pEdict = PEntityOfEntIndex(0);
} else {
pContext->ThrowNativeError("World not allowed");
return Data_Fail;
@@ -479,13 +479,13 @@ DataStatus DecodeValveParam(IPluginContext *pContext,
} else if (param == 0) {
if (data->decflags & VDECODE_FLAG_ALLOWWORLD)
{
pEdict = engine->PEntityOfEntIndex(0);
pEdict = PEntityOfEntIndex(0);
} else {
pContext->ThrowNativeError("World not allowed");
return Data_Fail;
}
} else {
pEdict = engine->PEntityOfEntIndex(param);
pEdict = PEntityOfEntIndex(param);
if (!pEdict || pEdict->IsFree())
{
pContext->ThrowNativeError("Entity %d is not valid or is freed", param);
@@ -547,13 +547,13 @@ DataStatus DecodeValveParam(IPluginContext *pContext,
} else if (param == 0) {
if (data->decflags & VDECODE_FLAG_ALLOWWORLD)
{
pEdict = engine->PEntityOfEntIndex(0);
pEdict = PEntityOfEntIndex(0);
} else {
pContext->ThrowNativeError("World not allowed");
return Data_Fail;
}
} else {
pEdict = engine->PEntityOfEntIndex(param);
pEdict = PEntityOfEntIndex(param);
if (!pEdict || pEdict->IsFree())
{
pContext->ThrowNativeError("Entity %d is not valid or is freed", param);