CSprite::ComputeWorldSpaceSurroundingBox
0x004c1c40 · 360 bytes · __thiscall
_ZN7CSprite31ComputeWorldSpaceSurroundingBoxEP6VectorS1_
Decompiled
undefined (3 params)
/* CSprite::ComputeWorldSpaceSurroundingBox(Vector*, Vector*) */
void __thiscall
CSprite::ComputeWorldSpaceSurroundingBox(CSprite *this,Vector *param_1,Vector *param_2)
{
code *pcVar1;
undefined4 uVar2;
int iVar3;
int iVar4;
float fVar5;
float fVar6;
fVar5 = *(float *)(this + 0x45c) * 0.5;
if (this[0x464] == (CSprite)0x0) {
pcVar1 = *(code **)(*modelinfo + 0x80);
uVar2 = CBaseEntity::GetModel((CBaseEntity *)this);
iVar3 = (*pcVar1)(modelinfo,uVar2);
pcVar1 = *(code **)(*modelinfo + 0x84);
uVar2 = CBaseEntity::GetModel((CBaseEntity *)this);
iVar4 = (*pcVar1)(modelinfo,uVar2);
fVar6 = (float)iVar4;
if ((float)iVar4 <= (float)iVar3) {
fVar6 = (float)iVar3;
}
fVar5 = fVar5 * fVar6;
}
fVar6 = -fVar5;
*(float *)param_1 = fVar6;
*(float *)(param_1 + 4) = fVar6;
*(float *)(param_1 + 8) = fVar6;
*(float *)param_2 = fVar5;
*(float *)(param_2 + 4) = fVar5;
*(float *)(param_2 + 8) = fVar5;
if (((byte)this[0x14d] & 8) != 0) {
CBaseEntity::CalcAbsolutePosition((CBaseEntity *)this);
}
*(float *)param_1 = *(float *)param_1 + *(float *)(this + 0x2e0);
*(float *)(param_1 + 4) = *(float *)(param_1 + 4) + *(float *)(this + 0x2e4);
*(float *)(param_1 + 8) = *(float *)(param_1 + 8) + *(float *)(this + 0x2e8);
if (((byte)this[0x14d] & 8) != 0) {
CBaseEntity::CalcAbsolutePosition((CBaseEntity *)this);
}
*(float *)param_2 = *(float *)param_2 + *(float *)(this + 0x2e0);
*(float *)(param_2 + 4) = *(float *)(param_2 + 4) + *(float *)(this + 0x2e4);
*(float *)(param_2 + 8) = *(float *)(param_2 + 8) + *(float *)(this + 0x2e8);
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.