ApplyViewLocking
0x00583830 · 274 bytes · __cdecl
_Z16ApplyViewLockingffR14ViewLockData_t27RemapAngleRange_CurvePart_t
Decompiled
undefined (4 params)
/* ApplyViewLocking(float, float, ViewLockData_t&, RemapAngleRange_CurvePart_t) */
longdouble ApplyViewLocking(float param_1,float param_2,float *param_3,int param_4)
{
int iVar1;
float fVar2;
float fVar3;
iVar1 = gpGlobals;
if (*param_3 == 0.0) goto LAB_005838c0;
if (param_4 == 2) {
LAB_00583896:
*(undefined1 *)(param_3 + 1) = 1;
param_3[2] = *param_3 + *(float *)(iVar1 + 0xc);
}
else {
if (*(char *)(param_3 + 1) != '\0') {
if (param_4 == 1) goto LAB_00583896;
if (*(float *)(gpGlobals + 0xc) < param_3[2] || *(float *)(gpGlobals + 0xc) == param_3[2])
goto LAB_00583900;
*(undefined1 *)(param_3 + 1) = 0;
if (param_3[3] <= 0.0) {
param_3[2] = 0.0;
}
else {
param_3[2] = *(float *)(iVar1 + 0xc);
}
}
if (param_3[2] == 0.0) {
LAB_005838c0:
return (longdouble)param_2;
}
fVar3 = *(float *)(gpGlobals + 0xc) - param_3[2];
if (param_3[3] == 0.0) {
fVar2 = param_2;
if (fVar3 < 0.0) {
LAB_00583900:
return (longdouble)param_1;
}
}
else {
fVar3 = fVar3 / param_3[3];
if (1.0 <= fVar3) {
fVar3 = 1.0;
}
if (fVar3 <= 0.0) {
fVar3 = 0.0;
}
param_1 = (param_2 - param_1) * fVar3 + param_1;
fVar2 = param_1;
if (fVar3 < 1.0) goto LAB_005838af;
}
param_1 = fVar2;
param_3[2] = 0.0;
}
LAB_005838af:
return (longdouble)param_1;
}
SourceMod gamedata
paste intoaddons/sourcemod/gamedata/<your_plugin>.txt
used as the SourceMod key — change to fit your plugin's convention
SourceMod library name (server / engine / matchmaking)
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.
Gamedata KeyValues
DHooks plugin example
Type inference is best-effort from the C signature - sanity-check the DHooks types before shipping.