EntityMatrix::InitFromEntity
0x00b2dfd0 · 277 bytes · __thiscall
_ZN12EntityMatrix14InitFromEntityEP11CBaseEntityi
Decompiled
undefined (3 params)
/* EntityMatrix::InitFromEntity(CBaseEntity*, int) */
void __thiscall EntityMatrix::InitFromEntity(EntityMatrix *this,CBaseEntity *param_1,int param_2)
{
char cVar1;
CBaseAnimating *this_00;
int iVar2;
int *piVar3;
Vector local_34 [12];
QAngle local_28 [24];
if (param_1 == (CBaseEntity *)0x0) {
MatrixSetIdentity((VMatrix *)this);
return;
}
if ((param_2 != 0) &&
(this_00 = (CBaseAnimating *)(**(code **)(*(int *)param_1 + 0xf0))(param_1),
this_00 != (CBaseAnimating *)0x0)) {
piVar3 = *(int **)(this_00 + 0x13e0);
if (piVar3 == (int *)0x0) {
iVar2 = CBaseEntity::GetModel((CBaseEntity *)this_00);
if (iVar2 == 0) {
piVar3 = *(int **)(this_00 + 0x13e0);
}
else {
CBaseAnimating::LockStudioHdr(this_00);
piVar3 = *(int **)(this_00 + 0x13e0);
}
if (piVar3 == (int *)0x0) goto LAB_00b2dfeb;
}
if (*piVar3 != 0) {
cVar1 = CBaseAnimating::GetAttachment(this_00,param_2,local_34,local_28);
if (cVar1 != '\0') {
VMatrix::SetupMatrixOrgAngles((VMatrix *)this,local_34,local_28);
return;
}
}
}
LAB_00b2dfeb:
if ((((byte)param_1[0x14d] & 8) != 0) &&
(CBaseEntity::CalcAbsolutePosition(param_1), ((byte)param_1[0x14d] & 8) != 0)) {
CBaseEntity::CalcAbsolutePosition(param_1);
}
VMatrix::SetupMatrixOrgAngles
((VMatrix *)this,(Vector *)(param_1 + 0x2e0),(QAngle *)(param_1 + 0x37c));
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.