UTIL_ScreenShake
0x00b2b2e0 · 570 bytes · __cdecl
_Z16UTIL_ScreenShakeRK6Vectorffff14ShakeCommand_tbP10CUtlVectorIP11CBasePlayer10CUtlMemoryIS5_iEE
Decompiled
undefined (8 params)
/* UTIL_ScreenShake(Vector const&, float, float, float, float, ShakeCommand_t, bool,
CUtlVector<CBasePlayer*, CUtlMemory<CBasePlayer*, int> >*) */
void UTIL_ScreenShake(float *param_1,float param_2,float param_3,float param_4,float param_5,
int param_6,char param_7,undefined4 *param_8)
{
CBasePlayer *pCVar1;
float *pfVar2;
int iVar3;
int iVar4;
float fVar5;
float local_44;
undefined **local_3c [11];
if (16.0 <= param_2) {
param_2 = 16.0;
}
if (*(int *)(gpGlobals + 0x14) < 1) {
return;
}
iVar4 = 1;
do {
while ((pCVar1 = (CBasePlayer *)UTIL_PlayerByIndex(iVar4), pCVar1 == (CBasePlayer *)0x0 ||
(((param_7 != '\x01' && (param_6 == 0)) && (((byte)pCVar1[0x150] & 1) == 0))))) {
LAB_00b2b4c8:
iVar4 = iVar4 + 1;
if (*(int *)(gpGlobals + 0x14) < iVar4) {
return;
}
}
if ((param_8 == (undefined4 *)0x0) || ((int)param_8[3] < 1)) {
LAB_00b2b388:
pfVar2 = (float *)(**(code **)(*(int *)pCVar1 + 0x288))(pCVar1);
local_44 = param_2;
if (0.0 < param_5) {
fVar5 = SQRT((*param_1 - *pfVar2) * (*param_1 - *pfVar2) +
(param_1[2] - pfVar2[2]) * (param_1[2] - pfVar2[2]) +
(param_1[1] - pfVar2[1]) * (param_1[1] - pfVar2[1]));
if (param_5 < fVar5) goto LAB_00b2b4c8;
local_44 = (1.0 - fVar5 * (1.0 / param_5)) * param_2;
}
if (0.0 <= local_44) {
if (local_44 <= 0.0) {
if (param_6 == 1) goto LAB_00b2b507;
}
else {
if (param_6 == 1) {
LAB_00b2b507:
local_44 = 0.0;
}
CRecipientFilter::CRecipientFilter((CRecipientFilter *)local_3c);
local_3c[0] = &PTR__CSingleUserRecipientFilter_00c08ea8;
/* try { // try from 00b2b458 to 00b2b45c has its CatchHandler @ 00b2b53d */
CRecipientFilter::AddRecipient((CRecipientFilter *)local_3c,pCVar1);
/* try { // try from 00b2b460 to 00b2b4b1 has its CatchHandler @ 00b2b524 */
CRecipientFilter::MakeReliable((CRecipientFilter *)local_3c);
UserMessageBegin((IRecipientFilter *)local_3c,"Shake");
MessageWriteByte(param_6);
MessageWriteFloat(local_44);
MessageWriteFloat(param_3);
MessageWriteFloat(param_4);
MessageEnd();
local_3c[0] = &PTR__CSingleUserRecipientFilter_00c08ea8;
CRecipientFilter::~CRecipientFilter((CRecipientFilter *)local_3c);
}
}
goto LAB_00b2b4c8;
}
if (pCVar1 == *(CBasePlayer **)*param_8) goto LAB_00b2b4c8;
iVar3 = 0;
do {
iVar3 = iVar3 + 1;
if (iVar3 == param_8[3]) goto LAB_00b2b388;
} while (pCVar1 != (CBasePlayer *)((int *)*param_8)[iVar3]);
if (iVar3 < 0) goto LAB_00b2b388;
iVar4 = iVar4 + 1;
if (*(int *)(gpGlobals + 0x14) < iVar4) {
return;
}
} while( true );
}
SourceMod gamedata
paste intoaddons/sourcemod/gamedata/<your_plugin>.txt
Just a Signatures{} block, ready to drop into a gamedata
file. Wire it up in your plugin however you like - SDKCall, DHooks,
raw memory ops, or anything else.
Signatures + Functions block. The plugin uses
DHookCreateFromConf - DHooks reads return type, this-type,
calling convention, and argument types straight from the gamedata. Less
boilerplate in the plugin, types travel with the gamedata.
Type inference is best-effort from the C signature - sanity-check the DHooks types before shipping.