L L4D2node

CSprite::ExpandThink

0x004c3430 · 305 bytes · __thiscall

_ZN7CSprite11ExpandThinkEv

Decompiled

undefined (1 param)

/* CSprite::ExpandThink() */

void __thiscall CSprite::ExpandThink(CSprite *this)

{
  CSprite CVar1;
  CBaseEdict *pCVar2;
  CSprite CVar3;
  int iVar4;
  float fVar5;
  
  fVar5 = *(float *)(gpGlobals + 0xc) - *(float *)(this + 0x470);
  SetSpriteScale(this,fVar5 * *(float *)(this + 0x11c) + *(float *)(this + 0x45c));
  CVar1 = this[0x127];
  iVar4 = (int)((float)*(int *)(this + 0x100) * fVar5);
  if (iVar4 <= (int)(uint)(byte)CVar1) {
    CVar3 = (CSprite)((char)CVar1 - (char)iVar4);
    if (CVar3 != CVar1) {
      if (this[0x6c] == (CSprite)0x0) {
        pCVar2 = *(CBaseEdict **)(this + 0x30);
        if (pCVar2 != (CBaseEdict *)0x0) {
          *(uint *)pCVar2 = *(uint *)pCVar2 | 0x101;
          iVar4 = CBaseEdict::GetChangeAccessor(pCVar2);
          *(undefined2 *)(iVar4 + 2) = 0;
        }
      }
      else {
        this[0x70] = (CSprite)((byte)this[0x70] | 1);
      }
      this[0x127] = CVar3;
    }
    CBaseEntity::SetNextThink((CBaseEntity *)this,*(float *)(gpGlobals + 0xc),(char *)0x0);
    *(undefined4 *)(this + 0x470) = *(undefined4 *)(gpGlobals + 0xc);
    return;
  }
  if (CVar1 == (CSprite)0x0) {
    CBaseEntity::Remove((CBaseEntity *)this);
    return;
  }
  if (this[0x6c] == (CSprite)0x0) {
    pCVar2 = *(CBaseEdict **)(this + 0x30);
    if (pCVar2 != (CBaseEdict *)0x0) {
      *(uint *)pCVar2 = *(uint *)pCVar2 | 0x101;
      iVar4 = CBaseEdict::GetChangeAccessor(pCVar2);
      *(undefined2 *)(iVar4 + 2) = 0;
    }
  }
  else {
    this[0x70] = (CSprite)((byte)this[0x70] | 1);
  }
  this[0x127] = (CSprite)0x0;
  CBaseEntity::Remove((CBaseEntity *)this);
  return;
}

SourceMod gamedata

paste into addons/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.



        

        

          

Type inference is best-effort from the C signature - sanity-check the DHooks types before shipping.

Return-type handling cheatsheet (DHookReturn)