L L4D2node

CEntityTemporaryMover::Push

0x0045cd70 · 301 bytes · __thiscall

_ZN21CEntityTemporaryMover4PushEP11CBaseEntity

Decompiled

undefined (2 params)

/* CEntityTemporaryMover::Push(CBaseEntity*) */

void __thiscall CEntityTemporaryMover::Push(CEntityTemporaryMover *this,CBaseEntity *param_1)

{
  int iVar1;
  int iVar2;
  void *pvVar3;
  int iVar4;
  int iVar5;
  undefined4 *puVar6;
  
  iVar1 = *(int *)(this + 0xc);
  iVar4 = *(int *)(this + 4);
  iVar5 = iVar1 + 1;
  if (iVar4 < iVar5) {
    iVar2 = *(int *)(this + 8);
    if (-1 < iVar2) {
      if (iVar2 == 0) {
        if (iVar4 == 0) {
          if (iVar5 < 3) {
            iVar4 = 2;
            goto LAB_0045ce36;
          }
          iVar4 = 2;
        }
        do {
          iVar4 = iVar4 * 2;
        } while (iVar4 < iVar5);
      }
      else {
        for (iVar4 = (iVar1 / iVar2 + 1) * iVar2; iVar4 < iVar5; iVar4 = (iVar4 + iVar5) / 2) {
        }
      }
LAB_0045ce36:
      *(int *)(this + 4) = iVar4;
      if (*(void **)this == (void *)0x0) {
        pvVar3 = malloc(iVar4 << 4);
        *(void **)this = pvVar3;
      }
      else {
        pvVar3 = realloc(*(void **)this,iVar4 << 4);
        *(void **)this = pvVar3;
        iVar5 = *(int *)(this + 0xc) + 1;
      }
      goto LAB_0045cd8e;
    }
  }
  pvVar3 = *(void **)this;
LAB_0045cd8e:
  *(int *)(this + 0xc) = iVar5;
  iVar4 = iVar1 * 0x10;
  iVar5 = (iVar5 - iVar1) + -1;
  *(void **)(this + 0x10) = pvVar3;
  if (0 < iVar5) {
    _V_memmove((void *)((int)pvVar3 + iVar4 + 0x10),(void *)((int)pvVar3 + iVar4),iVar5 * 0x10);
    pvVar3 = *(void **)this;
  }
  puVar6 = (undefined4 *)(iVar4 + (int)pvVar3);
  *puVar6 = param_1;
  if (((byte)param_1[0x14d] & 8) != 0) {
    CBaseEntity::CalcAbsolutePosition(param_1);
  }
  puVar6[1] = *(undefined4 *)(param_1 + 0x2e0);
  puVar6[2] = *(undefined4 *)(param_1 + 0x2e4);
  puVar6[3] = *(undefined4 *)(param_1 + 0x2e8);
  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)