L L4D2node

CBaseEntity::SetGroundEntity

0x00477310 · 503 bytes · __thiscall

_ZN11CBaseEntity15SetGroundEntityEPS_

Decompiled

undefined (2 params)

/* CBaseEntity::SetGroundEntity(CBaseEntity*) */

void __thiscall CBaseEntity::SetGroundEntity(CBaseEntity *this,CBaseEntity *param_1)

{
  int *piVar1;
  char cVar2;
  undefined4 *puVar3;
  uint uVar4;
  CBaseEntity *pCVar5;
  undefined *puVar6;
  bool bVar7;
  
  pCVar5 = (CBaseEntity *)0x0;
  uVar4 = *(uint *)(this + 600);
  if (((uVar4 != 0xffffffff) &&
      (puVar6 = g_pEntityList + (uVar4 & 0xfff) * 0x10, puVar6 != (undefined *)0xfffffffc)) &&
     (*(uint *)(puVar6 + 8) == uVar4 >> 0xc)) {
    pCVar5 = *(CBaseEntity **)(puVar6 + 4);
  }
  if (param_1 == pCVar5) {
    return;
  }
  if (param_1 != (CBaseEntity *)0x0) {
    cVar2 = (**(code **)(*(int *)this + 0x16c))(this);
    if (((cVar2 != '\0') && (param_1[0x186] == (CBaseEntity)0x6)) &&
       ((cVar2 = (**(code **)(*(int *)this + 0x16c))(this), cVar2 != '\0' &&
        ((piVar1 = *(int **)(param_1 + 0x238), piVar1 != (int *)0x0 &&
         (uVar4 = (**(code **)(*piVar1 + 0x50))(piVar1), (uVar4 & 4) != 0)))))) {
      (**(code **)(*(int *)this + 0x6f0))(this,param_1);
    }
    uVar4 = *(uint *)(this + 600);
  }
  if (((uVar4 == 0xffffffff) ||
      (puVar6 = g_pEntityList + (uVar4 & 0xfff) * 0x10, puVar6 == (undefined *)0xfffffffc)) ||
     (*(uint *)(puVar6 + 8) != uVar4 >> 0xc)) {
    pCVar5 = (CBaseEntity *)0x0;
  }
  else {
    pCVar5 = *(CBaseEntity **)(puVar6 + 4);
  }
  if (param_1 == pCVar5) {
LAB_004773e4:
    bVar7 = param_1 != (CBaseEntity *)0x0;
    if ((pCVar5 != (CBaseEntity *)0x0) || (!bVar7)) goto joined_r0x004774d6;
    AddEntityToGroundList(param_1,this);
LAB_00477419:
    AddFlag(this,1);
  }
  else {
    (**(code **)(*(int *)this + 0x2f4))(this,this + 600);
    if (param_1 != (CBaseEntity *)0x0) {
      puVar3 = (undefined4 *)(**(code **)(*(int *)param_1 + 0xc))(param_1);
      *(undefined4 *)(this + 600) = *puVar3;
      goto LAB_004773e4;
    }
    *(undefined4 *)(this + 600) = 0xffffffff;
    bVar7 = false;
joined_r0x004774d6:
    if ((pCVar5 == (CBaseEntity *)0x0) || (param_1 != (CBaseEntity *)0x0)) {
      PhysicsNotifyOtherOfGroundRemoval(this,pCVar5);
      AddEntityToGroundList(param_1,this);
      if (bVar7) goto LAB_00477419;
    }
    else {
      PhysicsNotifyOtherOfGroundRemoval(this,pCVar5);
    }
    RemoveFlag(this,1);
  }
  (**(code **)(*(int *)this + 0x278))(this,pCVar5,param_1);
  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)