CBasePlayerAnimState::OptimizeLayerWeights
0x0041f740 · 520 bytes · __thiscall
_ZN20CBasePlayerAnimState20OptimizeLayerWeightsEii
Decompiled
undefined (3 params)
/* CBasePlayerAnimState::OptimizeLayerWeights(int, int) */
void __thiscall
CBasePlayerAnimState::OptimizeLayerWeights(CBasePlayerAnimState *this,int param_1,int param_2)
{
undefined4 uVar1;
CBaseEdict *pCVar2;
float fVar3;
byte *pbVar4;
int iVar5;
undefined4 *puVar6;
int iVar7;
float local_24;
int local_20;
if (param_2 < 2) {
local_24 = 0.0;
}
else {
iVar7 = param_1 + 1;
local_24 = 0.0;
do {
pbVar4 = (byte *)CBaseAnimatingOverlay::GetAnimOverlay
(*(CBaseAnimatingOverlay **)(this + 0x14),iVar7);
if (((*pbVar4 & 1) != 0) && (0.0 < *(float *)(pbVar4 + 0x14))) {
local_24 = *(float *)(pbVar4 + 0x14) + local_24;
}
iVar7 = iVar7 + 1;
} while (iVar7 != param_2 + param_1);
}
pbVar4 = (byte *)CBaseAnimatingOverlay::GetAnimOverlay
(*(CBaseAnimatingOverlay **)(this + 0x14),param_1);
if (((*pbVar4 & 1) != 0) && (0.0 < *(float *)(pbVar4 + 0x14))) {
fVar3 = 1.0 - local_24;
if (1.0 - local_24 <= 0.0) {
fVar3 = 0.0;
}
if (fVar3 != *(float *)(pbVar4 + 0x14)) {
iVar7 = *(int *)(pbVar4 + 0x48);
if (iVar7 != 0) {
if (*(char *)(iVar7 + 0x6c) == '\0') {
pCVar2 = *(CBaseEdict **)(iVar7 + 0x30);
if (pCVar2 != (CBaseEdict *)0x0) {
*(uint *)pCVar2 = *(uint *)pCVar2 | 0x101;
iVar5 = CBaseEdict::GetChangeAccessor(pCVar2);
*(undefined2 *)(iVar5 + 2) = 0;
}
}
else {
*(byte *)(iVar7 + 0x70) = *(byte *)(iVar7 + 0x70) | 1;
}
uVar1 = *(undefined4 *)(gpGlobals + 0xc);
*(undefined4 *)(iVar7 + 0x78) = 0;
*(undefined4 *)(iVar7 + 0x74) = uVar1;
}
*(float *)(pbVar4 + 0x14) = fVar3;
}
}
iVar7 = 0;
local_20 = -1;
if (0 < param_2) {
do {
pbVar4 = (byte *)CBaseAnimatingOverlay::GetAnimOverlay
(*(CBaseAnimatingOverlay **)(this + 0x14),iVar7 + param_1);
if (((*pbVar4 & 1) != 0) && (0.99 < *(float *)(pbVar4 + 0x14))) {
local_20 = iVar7;
}
iVar7 = iVar7 + 1;
} while (iVar7 != param_2);
if (local_20 != -1) {
while (local_20 = local_20 + -1, local_20 != -1) {
puVar6 = (undefined4 *)
CBaseAnimatingOverlay::GetAnimOverlay
(*(CBaseAnimatingOverlay **)(this + 0x14),param_1 + local_20);
if (puVar6[0xf] != 0xf) {
iVar7 = puVar6[0x12];
if (iVar7 != 0) {
if (*(char *)(iVar7 + 0x6c) == '\0') {
pCVar2 = *(CBaseEdict **)(iVar7 + 0x30);
if (pCVar2 != (CBaseEdict *)0x0) {
*(uint *)pCVar2 = *(uint *)pCVar2 | 0x101;
iVar5 = CBaseEdict::GetChangeAccessor(pCVar2);
*(undefined2 *)(iVar5 + 2) = 0;
}
}
else {
*(byte *)(iVar7 + 0x70) = *(byte *)(iVar7 + 0x70) | 1;
}
uVar1 = *(undefined4 *)(gpGlobals + 0xc);
*(undefined4 *)(iVar7 + 0x78) = 0;
*(undefined4 *)(iVar7 + 0x74) = uVar1;
}
puVar6[0xf] = 0xf;
}
*puVar6 = 0;
}
}
}
return;
}
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.