CBaseAnimatingOverlay::AddLayeredSequence
0x005edaa0 · 916 bytes · __thiscall
_ZN21CBaseAnimatingOverlay18AddLayeredSequenceEii
Decompiled
undefined (3 params)
/* CBaseAnimatingOverlay::AddLayeredSequence(int, int) */
int __thiscall
CBaseAnimatingOverlay::AddLayeredSequence(CBaseAnimatingOverlay *this,int param_1,int param_2)
{
float fVar1;
float fVar2;
CBaseEdict *pCVar3;
byte bVar4;
int iVar5;
int iVar6;
undefined4 uVar7;
int iVar8;
CStudioHdr *pCVar9;
int iVar10;
CStudioHdr *pCVar11;
byte *pbVar12;
int iVar13;
iVar5 = AllocateLayer(this,param_2);
if (iVar5 < 0) {
return iVar5;
}
if (*(int *)(this + 0x1400) <= iVar5) {
return iVar5;
}
iVar13 = iVar5 * 0x4c;
pbVar12 = (byte *)(*(int *)(this + 0x13f4) + iVar13);
if ((*pbVar12 & 1) == 0) {
return iVar5;
}
if (*(float *)(pbVar12 + 0xc) != 0.0) {
iVar10 = *(int *)(pbVar12 + 0x48);
if (iVar10 != 0) {
if (*(char *)(iVar10 + 0x6c) == '\0') {
pCVar3 = *(CBaseEdict **)(iVar10 + 0x30);
if (pCVar3 != (CBaseEdict *)0x0) {
*(uint *)pCVar3 = *(uint *)pCVar3 | 0x101;
iVar8 = CBaseEdict::GetChangeAccessor(pCVar3);
*(undefined2 *)(iVar8 + 2) = 0;
}
}
else {
*(byte *)(iVar10 + 0x70) = *(byte *)(iVar10 + 0x70) | 1;
}
uVar7 = *(undefined4 *)(gpGlobals + 0xc);
*(undefined4 *)(iVar10 + 0x78) = 0;
*(undefined4 *)(iVar10 + 0x74) = uVar7;
}
pbVar12[0xc] = 0;
pbVar12[0xd] = 0;
pbVar12[0xe] = 0;
pbVar12[0xf] = 0;
pbVar12 = (byte *)(*(int *)(this + 0x13f4) + iVar13);
}
if (*(float *)(pbVar12 + 0x10) != 0.0) {
iVar10 = *(int *)(pbVar12 + 0x48);
if (iVar10 != 0) {
if (*(char *)(iVar10 + 0x6c) == '\0') {
pCVar3 = *(CBaseEdict **)(iVar10 + 0x30);
if (pCVar3 != (CBaseEdict *)0x0) {
*(uint *)pCVar3 = *(uint *)pCVar3 | 0x101;
iVar8 = CBaseEdict::GetChangeAccessor(pCVar3);
*(undefined2 *)(iVar8 + 2) = 0;
}
}
else {
*(byte *)(iVar10 + 0x70) = *(byte *)(iVar10 + 0x70) | 1;
}
uVar7 = *(undefined4 *)(gpGlobals + 0xc);
*(undefined4 *)(iVar10 + 0x78) = 0;
*(undefined4 *)(iVar10 + 0x74) = uVar7;
}
pbVar12[0x10] = 0;
pbVar12[0x11] = 0;
pbVar12[0x12] = 0;
pbVar12[0x13] = 0;
pbVar12 = (byte *)(*(int *)(this + 0x13f4) + iVar13);
}
pbVar12[0x18] = 0;
pbVar12[0x19] = 0;
pbVar12[0x1a] = 0x80;
pbVar12[0x1b] = 0x3f;
*(undefined4 *)(*(int *)(this + 0x13f4) + 0x34 + iVar13) = 0xffffffff;
iVar10 = *(int *)(this + 0x13f4) + iVar13;
if (param_1 != *(int *)(iVar10 + 8)) {
iVar8 = *(int *)(iVar10 + 0x48);
if (iVar8 != 0) {
if (*(char *)(iVar8 + 0x6c) == '\0') {
pCVar3 = *(CBaseEdict **)(iVar8 + 0x30);
if (pCVar3 != (CBaseEdict *)0x0) {
*(uint *)pCVar3 = *(uint *)pCVar3 | 0x101;
iVar6 = CBaseEdict::GetChangeAccessor(pCVar3);
*(undefined2 *)(iVar6 + 2) = 0;
}
}
else {
*(byte *)(iVar8 + 0x70) = *(byte *)(iVar8 + 0x70) | 1;
}
uVar7 = *(undefined4 *)(gpGlobals + 0xc);
*(undefined4 *)(iVar8 + 0x78) = 0;
*(undefined4 *)(iVar8 + 0x74) = uVar7;
}
*(int *)(iVar10 + 8) = param_1;
iVar10 = *(int *)(this + 0x13f4) + iVar13;
}
if (*(float *)(iVar10 + 0x14) != 1.0) {
iVar8 = *(int *)(iVar10 + 0x48);
if (iVar8 != 0) {
if (*(char *)(iVar8 + 0x6c) == '\0') {
pCVar3 = *(CBaseEdict **)(iVar8 + 0x30);
if (pCVar3 != (CBaseEdict *)0x0) {
*(uint *)pCVar3 = *(uint *)pCVar3 | 0x101;
iVar6 = CBaseEdict::GetChangeAccessor(pCVar3);
*(undefined2 *)(iVar6 + 2) = 0;
}
}
else {
*(byte *)(iVar8 + 0x70) = *(byte *)(iVar8 + 0x70) | 1;
}
uVar7 = *(undefined4 *)(gpGlobals + 0xc);
*(undefined4 *)(iVar8 + 0x78) = 0;
*(undefined4 *)(iVar8 + 0x74) = uVar7;
}
*(undefined4 *)(iVar10 + 0x14) = 0x3f800000;
iVar10 = *(int *)(this + 0x13f4) + iVar13;
}
*(undefined4 *)(iVar10 + 0x1c) = 0;
*(undefined4 *)(*(int *)(this + 0x13f4) + 0x20 + iVar13) = 0;
*(undefined1 *)(*(int *)(this + 0x13f4) + 4 + iVar13) = 0;
*(undefined4 *)(*(int *)(this + 0x13f4) + 0x40 + iVar13) = 0;
iVar10 = *(int *)(this + 0x13f4);
pCVar9 = *(CStudioHdr **)(this + 0x13e0);
if (pCVar9 == (CStudioHdr *)0x0) {
iVar8 = CBaseEntity::GetModel((CBaseEntity *)this);
if (iVar8 == 0) {
pCVar9 = *(CStudioHdr **)(this + 0x13e0);
}
else {
CBaseAnimating::LockStudioHdr((CBaseAnimating *)this);
pCVar9 = *(CStudioHdr **)(this + 0x13e0);
}
pCVar11 = (CStudioHdr *)0x0;
if (pCVar9 == (CStudioHdr *)0x0) goto LAB_005edbe4;
}
pCVar11 = (CStudioHdr *)0x0;
if (*(int *)pCVar9 != 0) {
pCVar11 = pCVar9;
}
LAB_005edbe4:
bVar4 = GetSequenceFlags(pCVar11,param_1);
*(byte *)(iVar10 + iVar13 + 5) = bVar4 & 1;
pbVar12 = (byte *)(iVar10 + iVar13 + 5);
*pbVar12 = *pbVar12 & 1;
if ((*(int *)(ai_sequence_debug._28_4_ + 0x30) != 0) && (((byte)this[0x111] & 0x10) != 0)) {
iVar10 = *(int *)(this + 0x13f4) + iVar13;
fVar1 = *(float *)(iVar10 + 0x14);
fVar2 = *(float *)(iVar10 + 0xc);
uVar7 = CBaseAnimating::GetSequenceName((CBaseAnimating *)this,*(int *)(iVar10 + 8));
Msg("%5.3f : adding %d (%d): %s : %5.3f (%.3f)\n",(double)*(float *)(gpGlobals + 0xc),iVar5,
*(undefined4 *)(*(int *)(this + 0x13f4) + 0x3c + iVar13),uVar7,(double)fVar2,(double)fVar1);
}
return iVar5;
}
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.