CSprite::TurnOn
0x004c3840 · 361 bytes · __thiscall
_ZN7CSprite6TurnOnEv
Decompiled
undefined (1 param)
/* CSprite::TurnOn() */
void __thiscall CSprite::TurnOn(CSprite *this)
{
float fVar1;
CBaseEdict *pCVar2;
int iVar3;
uint *puVar4;
uint uVar5;
undefined1 local_14 [8];
uVar5 = *(uint *)(this + 0xd4) & 0xffffffdf;
if (*(uint *)(this + 0xd4) == uVar5) {
puVar4 = *(uint **)(this + 0x30);
}
else {
if (this[0x6c] == (CSprite)0x0) {
pCVar2 = *(CBaseEdict **)(this + 0x30);
puVar4 = (uint *)0x0;
if (pCVar2 != (CBaseEdict *)0x0) {
*(uint *)pCVar2 = *(uint *)pCVar2 | 0x101;
iVar3 = CBaseEdict::GetChangeAccessor(pCVar2);
*(undefined2 *)(iVar3 + 2) = 0;
puVar4 = *(uint **)(this + 0x30);
}
}
else {
this[0x70] = (CSprite)((byte)this[0x70] | 1);
puVar4 = *(uint **)(this + 0x30);
}
*(uint *)(this + 0xd4) = uVar5;
}
if (puVar4 != (uint *)0x0) {
*puVar4 = *puVar4 | 0x80;
}
CBaseEntity::DispatchUpdateTransmitState((CBaseEntity *)this);
if (((*(float *)(this + 0x448) != 0.0) && (1.0 < *(float *)(this + 0x474))) ||
(((byte)this[0x148] & 2) != 0)) {
CBaseEntity::ThinkSet((_func_void *)local_14,(float)this,(char *)AnimateThink);
CBaseEntity::SetNextThink((CBaseEntity *)this,*(float *)(gpGlobals + 0xc),(char *)0x0);
fVar1 = *(float *)(this + 0x44c);
*(undefined4 *)(this + 0x470) = *(undefined4 *)(gpGlobals + 0xc);
}
else {
fVar1 = *(float *)(this + 0x44c);
}
if (fVar1 == 0.0) {
return;
}
if (this[0x6c] == (CSprite)0x0) {
pCVar2 = *(CBaseEdict **)(this + 0x30);
if (pCVar2 != (CBaseEdict *)0x0) {
*(uint *)pCVar2 = *(uint *)pCVar2 | 0x101;
iVar3 = CBaseEdict::GetChangeAccessor(pCVar2);
*(undefined2 *)(iVar3 + 2) = 0;
}
*(undefined4 *)(this + 0x44c) = 0;
}
else {
this[0x70] = (CSprite)((byte)this[0x70] | 1);
*(undefined4 *)(this + 0x44c) = 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.