Update for latest Blade Symphony SDK
This commit is contained in:
+78
-78
@@ -301,31 +301,31 @@ static cell_t RemoveEntity(IPluginContext *pContext, const cell_t *params)
|
||||
// Some games have UTIL_Remove exposed on IServerTools, but for consistence, we'll
|
||||
// use this method for all. Results in DeathNotice( this ) being called on parent,
|
||||
// and parent being cleared (both if any parent) before UTIL_Remove is called.
|
||||
static inputfunc_t fnKillEntity = nullptr;
|
||||
if (!fnKillEntity)
|
||||
{
|
||||
// Get world, as other ents aren't guaranteed to inherit full datadesc (but kill func is same for all)
|
||||
CBaseEntity *pGetterEnt = g_HL2.ReferenceToEntity(0);
|
||||
if (pGetterEnt == nullptr)
|
||||
{
|
||||
// If we don't have a world entity yet, we'll have to rely on the given entity. Does this even make sense???
|
||||
pGetterEnt = pEntity;
|
||||
}
|
||||
|
||||
datamap_t *pMap = g_HL2.GetDataMap(pGetterEnt);
|
||||
|
||||
sm_datatable_info_t info;
|
||||
if (!g_HL2.FindDataMapInfo(pMap, "InputKill", &info))
|
||||
{
|
||||
return pContext->ThrowNativeError("Failed to find Kill input!");
|
||||
}
|
||||
|
||||
fnKillEntity = info.prop->inputFunc;
|
||||
}
|
||||
|
||||
static inputfunc_t fnKillEntity = nullptr;
|
||||
if (!fnKillEntity)
|
||||
{
|
||||
// Get world, as other ents aren't guaranteed to inherit full datadesc (but kill func is same for all)
|
||||
CBaseEntity *pGetterEnt = g_HL2.ReferenceToEntity(0);
|
||||
if (pGetterEnt == nullptr)
|
||||
{
|
||||
// If we don't have a world entity yet, we'll have to rely on the given entity. Does this even make sense???
|
||||
pGetterEnt = pEntity;
|
||||
}
|
||||
|
||||
datamap_t *pMap = g_HL2.GetDataMap(pGetterEnt);
|
||||
|
||||
sm_datatable_info_t info;
|
||||
if (!g_HL2.FindDataMapInfo(pMap, "InputKill", &info))
|
||||
{
|
||||
return pContext->ThrowNativeError("Failed to find Kill input!");
|
||||
}
|
||||
|
||||
fnKillEntity = info.prop->inputFunc;
|
||||
}
|
||||
|
||||
// Input data is ignored for this. No need to initialize
|
||||
static inputdata_t data;
|
||||
|
||||
static inputdata_t data;
|
||||
|
||||
(pEntity->*fnKillEntity)(data);
|
||||
|
||||
return 1;
|
||||
@@ -1379,7 +1379,7 @@ static cell_t GetEntProp(IPluginContext *pContext, const cell_t *params)
|
||||
// This isn't in CS:S yet, but will be, doesn't hurt to add now, and will save us a build later
|
||||
#if SOURCE_ENGINE == SE_CSS || SOURCE_ENGINE == SE_HL2DM || SOURCE_ENGINE == SE_DODS \
|
||||
|| SOURCE_ENGINE == SE_BMS || SOURCE_ENGINE == SE_SDK2013 || SOURCE_ENGINE == SE_TF2 \
|
||||
|| SOURCE_ENGINE == SE_CSGO
|
||||
|| SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE
|
||||
if (pProp->GetFlags() & SPROP_VARINT)
|
||||
{
|
||||
bit_count = sizeof(int) * 8;
|
||||
@@ -1498,7 +1498,7 @@ static cell_t SetEntProp(IPluginContext *pContext, const cell_t *params)
|
||||
// This isn't in CS:S yet, but will be, doesn't hurt to add now, and will save us a build later
|
||||
#if SOURCE_ENGINE == SE_CSS || SOURCE_ENGINE == SE_HL2DM || SOURCE_ENGINE == SE_DODS \
|
||||
|| SOURCE_ENGINE == SE_BMS || SOURCE_ENGINE == SE_SDK2013 || SOURCE_ENGINE == SE_TF2 \
|
||||
|| SOURCE_ENGINE == SE_CSGO
|
||||
|| SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE
|
||||
if (pProp->GetFlags() & SPROP_VARINT)
|
||||
{
|
||||
bit_count = sizeof(int) * 8;
|
||||
@@ -1829,22 +1829,22 @@ static cell_t SetEntPropEnt(IPluginContext *pContext, const cell_t *params)
|
||||
|
||||
switch (td->fieldType)
|
||||
{
|
||||
case FIELD_EHANDLE:
|
||||
type = PropEnt_Handle;
|
||||
break;
|
||||
case FIELD_CLASSPTR:
|
||||
type = PropEnt_Entity;
|
||||
break;
|
||||
case FIELD_EDICT:
|
||||
type = PropEnt_Edict;
|
||||
if (!pEdict)
|
||||
return pContext->ThrowNativeError("Edict %d is invalid", params[1]);
|
||||
break;
|
||||
case FIELD_CUSTOM:
|
||||
if ((td->flags & FTYPEDESC_OUTPUT) == FTYPEDESC_OUTPUT)
|
||||
{
|
||||
type = PropEnt_Variant;
|
||||
}
|
||||
case FIELD_EHANDLE:
|
||||
type = PropEnt_Handle;
|
||||
break;
|
||||
case FIELD_CLASSPTR:
|
||||
type = PropEnt_Entity;
|
||||
break;
|
||||
case FIELD_EDICT:
|
||||
type = PropEnt_Edict;
|
||||
if (!pEdict)
|
||||
return pContext->ThrowNativeError("Edict %d is invalid", params[1]);
|
||||
break;
|
||||
case FIELD_CUSTOM:
|
||||
if ((td->flags & FTYPEDESC_OUTPUT) == FTYPEDESC_OUTPUT)
|
||||
{
|
||||
type = PropEnt_Variant;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -1881,9 +1881,9 @@ static cell_t SetEntPropEnt(IPluginContext *pContext, const cell_t *params)
|
||||
|
||||
switch (type)
|
||||
{
|
||||
case PropEnt_Handle:
|
||||
case PropEnt_Variant:
|
||||
{
|
||||
case PropEnt_Handle:
|
||||
case PropEnt_Variant:
|
||||
{
|
||||
CBaseHandle *hndl;
|
||||
if (type == PropEnt_Handle)
|
||||
{
|
||||
@@ -1893,44 +1893,44 @@ static cell_t SetEntPropEnt(IPluginContext *pContext, const cell_t *params)
|
||||
{
|
||||
auto *pVariant = (variant_t *)((intptr_t)pEntity + offset);
|
||||
hndl = &pVariant->eVal;
|
||||
}
|
||||
|
||||
hndl->Set((IHandleEntity *) pOther);
|
||||
|
||||
if (params[2] == Prop_Send && (pEdict != NULL))
|
||||
{
|
||||
g_HL2.SetEdictStateChanged(pEdict, offset);
|
||||
}
|
||||
|
||||
hndl->Set((IHandleEntity *) pOther);
|
||||
|
||||
if (params[2] == Prop_Send && (pEdict != NULL))
|
||||
{
|
||||
g_HL2.SetEdictStateChanged(pEdict, offset);
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case PropEnt_Entity:
|
||||
{
|
||||
*(CBaseEntity **) ((uint8_t *) pEntity + offset) = pOther;
|
||||
break;
|
||||
}
|
||||
|
||||
case PropEnt_Edict:
|
||||
{
|
||||
edict_t *pOtherEdict = NULL;
|
||||
break;
|
||||
|
||||
case PropEnt_Entity:
|
||||
{
|
||||
*(CBaseEntity **) ((uint8_t *) pEntity + offset) = pOther;
|
||||
break;
|
||||
}
|
||||
|
||||
case PropEnt_Edict:
|
||||
{
|
||||
edict_t *pOtherEdict = NULL;
|
||||
if (pOther)
|
||||
{
|
||||
IServerNetworkable *pNetworkable = ((IServerUnknown *) pOther)->GetNetworkable();
|
||||
if (!pNetworkable)
|
||||
{
|
||||
return pContext->ThrowNativeError("Entity %d (%d) does not have a valid edict", g_HL2.ReferenceToIndex(params[4]), params[4]);
|
||||
}
|
||||
|
||||
pOtherEdict = pNetworkable->GetEdict();
|
||||
if (!pOtherEdict || pOtherEdict->IsFree())
|
||||
{
|
||||
return pContext->ThrowNativeError("Entity %d (%d) does not have a valid edict", g_HL2.ReferenceToIndex(params[4]), params[4]);
|
||||
}
|
||||
}
|
||||
|
||||
*(edict_t **) ((uint8_t *) pEntity + offset) = pOtherEdict;
|
||||
break;
|
||||
IServerNetworkable *pNetworkable = ((IServerUnknown *) pOther)->GetNetworkable();
|
||||
if (!pNetworkable)
|
||||
{
|
||||
return pContext->ThrowNativeError("Entity %d (%d) does not have a valid edict", g_HL2.ReferenceToIndex(params[4]), params[4]);
|
||||
}
|
||||
|
||||
pOtherEdict = pNetworkable->GetEdict();
|
||||
if (!pOtherEdict || pOtherEdict->IsFree())
|
||||
{
|
||||
return pContext->ThrowNativeError("Entity %d (%d) does not have a valid edict", g_HL2.ReferenceToIndex(params[4]), params[4]);
|
||||
}
|
||||
}
|
||||
|
||||
*(edict_t **) ((uint8_t *) pEntity + offset) = pOtherEdict;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user