L L4D2node

CBaseEntity::WorldSpaceCenter

0x0040c860 · 684 bytes · __thiscall

_ZNK11CBaseEntity16WorldSpaceCenterEv

Decompiled

undefined (1 param)

/* WARNING: Removing unreachable block (ram,0x0040c8df) */
/* WARNING: Removing unreachable block (ram,0x0040c89d) */
/* WARNING: Removing unreachable block (ram,0x0040cb19) */
/* WARNING: Removing unreachable block (ram,0x0040cb20) */
/* CBaseEntity::WorldSpaceCenter() const */

float * __thiscall CBaseEntity::WorldSpaceCenter(CBaseEntity *this)

{
  CBaseEntity *pCVar1;
  float *pfVar2;
  float *pfVar3;
  matrix3x4_t *pmVar4;
  int iVar5;
  int iVar6;
  
  pCVar1 = this + 0x194;
  if ((AllocTempVector()::s_vecTemp == '\0') &&
     (iVar6 = __cxa_guard_acquire(&AllocTempVector()::s_vecTemp), iVar6 != 0)) {
    __cxa_guard_release(&AllocTempVector()::s_vecTemp);
  }
  if ((AllocTempVector()::s_nIndex == '\0') &&
     (iVar6 = __cxa_guard_acquire(&AllocTempVector()::s_nIndex), iVar6 != 0)) {
    AllocTempVector()::s_nIndex = 0;
    __cxa_guard_release(&AllocTempVector()::s_nIndex);
  }
  AllocTempVector()::s_nIndex = AllocTempVector()::s_nIndex + 0x10001 & 0x7f;
  LOCK();
  UNLOCK();
  iVar6 = AllocTempVector()::s_nIndex * 0xc;
  pfVar2 = (float *)(AllocTempVector()::s_vecTemp + iVar6);
  if ((AllocTempVector()::s_vecTemp == '\0') &&
     (iVar5 = __cxa_guard_acquire(&AllocTempVector()::s_vecTemp), iVar5 != 0)) {
    __cxa_guard_release(&AllocTempVector()::s_vecTemp);
  }
  if ((AllocTempVector()::s_nIndex == '\0') &&
     (iVar5 = __cxa_guard_acquire(&AllocTempVector()::s_nIndex), iVar5 != 0)) {
    AllocTempVector()::s_nIndex = 0;
    __cxa_guard_release(&AllocTempVector()::s_nIndex);
  }
  AllocTempVector()::s_nIndex = AllocTempVector()::s_nIndex + 0x10001 & 0x7f;
  LOCK();
  UNLOCK();
  iVar5 = AllocTempVector()::s_nIndex * 0xc;
  *(float *)(AllocTempVector()::s_vecTemp + iVar5) =
       (*(float *)(this + 0x1a8) - *(float *)(this + 0x19c)) * 0.5 + *(float *)(this + 0x19c);
  *(float *)(AllocTempVector()::s_vecTemp + iVar5 + 4) =
       (*(float *)(this + 0x1ac) - *(float *)(this + 0x1a0)) * 0.5 + *(float *)(this + 0x1a0);
  *(float *)(AllocTempVector()::s_vecTemp + iVar5 + 8) =
       (*(float *)(this + 0x1b0) - *(float *)(this + 0x1a4)) * 0.5 + *(float *)(this + 0x1a4);
  if (((((byte)this[0x1b4] & 0x40) == 0) && (((byte)this[0x1b6] & 0xfd) != 0)) &&
     ((pfVar3 = (float *)(**(code **)(*(int *)(this + 0x194) + 0x24))(pCVar1), vec3_angle != *pfVar3
      || ((DAT_01053d40 != pfVar3[1] || (DAT_01053d44 != pfVar3[2])))))) {
    pmVar4 = (matrix3x4_t *)(**(code **)(*(int *)(this + 0x194) + 0x28))(pCVar1);
    VectorTransform((float *)(AllocTempVector()::s_vecTemp + iVar5),pmVar4,pfVar2);
    return pfVar2;
  }
  pfVar3 = (float *)(**(code **)(*(int *)(this + 0x194) + 0x20))(pCVar1);
  *(float *)(AllocTempVector()::s_vecTemp + iVar6) =
       *pfVar3 + *(float *)(AllocTempVector()::s_vecTemp + iVar5);
  *(float *)(AllocTempVector()::s_vecTemp + iVar6 + 4) =
       pfVar3[1] + *(float *)(AllocTempVector()::s_vecTemp + iVar5 + 4);
  *(float *)(AllocTempVector()::s_vecTemp + iVar6 + 8) =
       pfVar3[2] + *(float *)(AllocTempVector()::s_vecTemp + iVar5 + 8);
  return pfVar2;
}

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)