L L4D2node

CBaseEntity::AddEntityToGroundList

0x00475c90 · 286 bytes · __thiscall

_ZN11CBaseEntity21AddEntityToGroundListEPS_

Decompiled

undefined (2 params)

/* CBaseEntity::AddEntityToGroundList(CBaseEntity*) */

uint * __thiscall CBaseEntity::AddEntityToGroundList(CBaseEntity *this,CBaseEntity *param_1)

{
  uint uVar1;
  uint *puVar2;
  uint *puVar3;
  uint *puVar4;
  undefined *puVar5;
  
  if ((this != param_1) && (((byte)param_1[0x14c] & 1) == 0)) {
    puVar2 = (uint *)GetDataObject(this,0);
    if (puVar2 == (uint *)0x0) {
      puVar2 = (uint *)CreateDataObject(this,0);
      puVar2[1] = (uint)puVar2;
      puVar2[2] = (uint)puVar2;
    }
    else {
      for (puVar3 = (uint *)puVar2[1]; puVar2 != puVar3; puVar3 = (uint *)puVar3[1]) {
        uVar1 = *puVar3;
        if ((((uVar1 != 0xffffffff) &&
             (puVar5 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar5 != (undefined *)0xfffffffc))
            && (*(uint *)(puVar5 + 8) == uVar1 >> 0xc)) &&
           (param_1 == *(CBaseEntity **)(puVar5 + 4))) {
          return puVar3;
        }
      }
    }
    puVar3 = (uint *)CUtlMemoryPool::Alloc((CUtlMemoryPool *)g_EntityGroundLinks,0xc);
    if (puVar3 != (uint *)0x0) {
      groundlinksallocated = groundlinksallocated + 1;
      puVar4 = (uint *)(**(code **)(*(int *)param_1 + 0xc))(param_1);
      *puVar3 = *puVar4;
      uVar1 = puVar2[1];
      puVar3[2] = (uint)puVar2;
      puVar3[1] = uVar1;
      puVar2[1] = (uint)puVar3;
      *(uint **)(puVar3[1] + 8) = puVar3;
      PhysicsStartGroundContact(this,param_1);
      return puVar3;
    }
    DevMsg("AllocGroundLink: failed to allocate groundlink_t.!!!\n");
  }
  return (uint *)0x0;
}

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)