L L4D2node

CBeam::SplineInit

0x00427950 · 538 bytes · __thiscall

_ZN5CBeam10SplineInitEiPP11CBaseEntityPi

Decompiled

undefined (4 params)

/* CBeam::SplineInit(int, CBaseEntity**, int*) */

void __thiscall CBeam::SplineInit(CBeam *this,int param_1,CBaseEntity **param_2,int *param_3)

{
  CBaseEdict *pCVar1;
  CBaseEntity *pCVar2;
  int iVar3;
  undefined4 *puVar4;
  int iVar5;
  CBeam *__s1;
  undefined4 local_20 [4];
  
  if (param_1 < 2) {
    Msg("ERROR: Min of 2 ents required for spline beam.\n");
  }
  else if (10 < param_1) {
    Msg("ERROR: Max of %i ents allowed for spline beam.\n",10);
  }
  if (*(int *)(this + 0x458) != 4) {
    if (this[0x6c] == (CBeam)0x0) {
      pCVar1 = *(CBaseEdict **)(this + 0x30);
      if (pCVar1 != (CBaseEdict *)0x0) {
        *(uint *)pCVar1 = *(uint *)pCVar1 | 0x101;
        iVar3 = CBaseEdict::GetChangeAccessor(pCVar1);
        *(undefined2 *)(iVar3 + 2) = 0;
      }
    }
    else {
      this[0x70] = (CBeam)((byte)this[0x70] | 1);
    }
    *(undefined4 *)(this + 0x458) = 4;
  }
  if (0 < param_1) {
    iVar3 = 0;
    __s1 = this + 0x488;
    do {
      while( true ) {
        local_20[0] = 0xffffffff;
        pCVar2 = param_2[iVar3];
        if (pCVar2 != (CBaseEntity *)0x0) {
          puVar4 = (undefined4 *)(**(code **)(*(int *)pCVar2 + 0xc))(pCVar2);
          local_20[0] = *puVar4;
        }
        iVar5 = memcmp(__s1 + -0x28,local_20,4);
        if (iVar5 != 0) {
          if (this[0x6c] == (CBeam)0x0) {
            pCVar1 = *(CBaseEdict **)(this + 0x30);
            if (pCVar1 != (CBaseEdict *)0x0) {
              *(uint *)pCVar1 = *(uint *)pCVar1 | 0x101;
              iVar5 = CBaseEdict::GetChangeAccessor(pCVar1);
              *(undefined2 *)(iVar5 + 2) = 0;
            }
          }
          else {
            this[0x70] = (CBeam)((byte)this[0x70] | 1);
          }
          *(undefined4 *)(__s1 + -0x28) = local_20[0];
        }
        iVar5 = memcmp(__s1,param_3,4);
        if (iVar5 != 0) break;
        iVar3 = iVar3 + 1;
        param_3 = param_3 + 1;
        __s1 = __s1 + 4;
        if (iVar3 == param_1) goto LAB_00427ace;
      }
      if (this[0x6c] == (CBeam)0x0) {
        pCVar1 = *(CBaseEdict **)(this + 0x30);
        if (pCVar1 != (CBaseEdict *)0x0) {
          *(uint *)pCVar1 = *(uint *)pCVar1 | 0x101;
          iVar5 = CBaseEdict::GetChangeAccessor(pCVar1);
          *(undefined2 *)(iVar5 + 2) = 0;
        }
      }
      else {
        this[0x70] = (CBeam)((byte)this[0x70] | 1);
      }
      iVar3 = iVar3 + 1;
      iVar5 = *param_3;
      param_3 = param_3 + 1;
      *(int *)__s1 = iVar5;
      __s1 = __s1 + 4;
    } while (iVar3 != param_1);
  }
LAB_00427ace:
  if (*(int *)(this + 0x450) != param_1) {
    if (this[0x6c] == (CBeam)0x0) {
      pCVar1 = *(CBaseEdict **)(this + 0x30);
      if (pCVar1 != (CBaseEdict *)0x0) {
        *(uint *)pCVar1 = *(uint *)pCVar1 | 0x101;
        iVar3 = CBaseEdict::GetChangeAccessor(pCVar1);
        *(undefined2 *)(iVar3 + 2) = 0;
      }
    }
    else {
      this[0x70] = (CBeam)((byte)this[0x70] | 1);
    }
    *(int *)(this + 0x450) = param_1;
  }
  RelinkBeam(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)