extensions/sdktools/tenatives.cpp
changeset 1039 71e55e3fd8f7
parent 1031 d9cf44ddcd9c
child 1233 e9cfc03b9bb8
     1.1 --- a/extensions/sdktools/tenatives.cpp	Wed Jul 04 12:34:57 2007 +0000
     1.2 +++ b/extensions/sdktools/tenatives.cpp	Thu Jul 05 00:21:59 2007 +0000
     1.3 @@ -116,6 +116,31 @@
     1.4  	return 1;
     1.5  }
     1.6  
     1.7 +static cell_t smn_TEWriteFloatArray(IPluginContext *pContext, const cell_t *params)
     1.8 +{
     1.9 +	if (!g_TEManager.IsAvailable())
    1.10 +	{
    1.11 +		return pContext->ThrowNativeError("TempEntity System unsupported or not available, file a bug report");
    1.12 +	}
    1.13 +	if (!g_CurrentTE)
    1.14 +	{
    1.15 +		return pContext->ThrowNativeError("No TempEntity call is in progress");
    1.16 +	}
    1.17 +
    1.18 +	char *prop;
    1.19 +	pContext->LocalToString(params[1], &prop);
    1.20 +
    1.21 +	cell_t *addr;
    1.22 +	pContext->LocalToPhysAddr(params[2], &addr);
    1.23 +
    1.24 +	if (!g_CurrentTE->TE_SetEntDataFloatArray(prop, addr, params[3]))
    1.25 +	{
    1.26 +		return pContext->ThrowNativeError("Temp entity property \"%s\" not found", prop);
    1.27 +	}
    1.28 +
    1.29 +	return 1;
    1.30 +}
    1.31 +
    1.32  static cell_t smn_TESend(IPluginContext *pContext, const cell_t *params)
    1.33  {
    1.34  	if (!g_TEManager.IsAvailable())
    1.35 @@ -165,5 +190,6 @@
    1.36  	{"TE_WriteAngles",			smn_TEWriteVector},
    1.37  	{"TE_Send",					smn_TESend},
    1.38  	{"TE_IsValidProp",			smn_TEIsValidProp},
    1.39 +	{"TE_WriteFloatArray",		smn_TEWriteFloatArray},
    1.40  	{NULL,						NULL}
    1.41  };