Added new param to CTFPlayerShared::Disguise call in TF2 ext (bug 4866, r=fyren).

This commit is contained in:
Nicholas Hastings 2011-04-15 12:11:32 -04:00
parent b9f82332c8
commit d099febf7b

View File

@ -147,7 +147,7 @@ cell_t TF2_Disguise(IPluginContext *pContext, const cell_t *params)
if (!pWrapper)
{
REGISTER_NATIVE_ADDR("Disguise",
PassInfo pass[3]; \
PassInfo pass[4]; \
pass[0].flags = PASSFLAG_BYVAL; \
pass[0].size = sizeof(int); \
pass[0].type = PassType_Basic; \
@ -157,7 +157,10 @@ cell_t TF2_Disguise(IPluginContext *pContext, const cell_t *params)
pass[2].flags = PASSFLAG_BYVAL; \
pass[2].size = sizeof(CBaseEntity *); \
pass[2].type = PassType_Basic; \
pWrapper = g_pBinTools->CreateCall(addr, CallConv_ThisCall, NULL, pass, 3))
pass[3].flags = PASSFLAG_BYVAL; \
pass[3].size = sizeof(bool); \
pass[3].type = PassType_Basic; \
pWrapper = g_pBinTools->CreateCall(addr, CallConv_ThisCall, NULL, pass, 4))
}
CBaseEntity *pEntity;
@ -175,7 +178,7 @@ cell_t TF2_Disguise(IPluginContext *pContext, const cell_t *params)
return pContext->ThrowNativeError("Target client index %d is not valid", params[1]);
}
unsigned char vstk[sizeof(void *) + 2*sizeof(int)];
unsigned char vstk[sizeof(void *) + 2*sizeof(int) + sizeof(bool)];
unsigned char *vptr = vstk;
@ -186,7 +189,9 @@ cell_t TF2_Disguise(IPluginContext *pContext, const cell_t *params)
*(int *)vptr = params[3];
vptr += sizeof(int);
*(CBaseEntity **)vptr = pTarget;
vptr += sizeof(CBaseEntity *);
*(bool *)vptr = true;
pWrapper->Execute(vstk, NULL);
return 1;