L L4D2node

CFuncTrain::SetupTarget

0x00b0c050 · 210 bytes · __thiscall

_ZN10CFuncTrain11SetupTargetEv

Decompiled

undefined (1 param)

/* CFuncTrain::SetupTarget() */

void __thiscall CFuncTrain::SetupTarget(CFuncTrain *this)

{
  uint uVar1;
  char *pcVar2;
  int *piVar3;
  undefined4 *puVar4;
  undefined *puVar5;
  undefined1 *puVar6;
  
  uVar1 = *(uint *)(this + 0x4d0);
  if ((((uVar1 != 0xffffffff) &&
       (puVar5 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar5 != (undefined *)0xfffffffc)) &&
      (*(uint *)(puVar5 + 8) == uVar1 >> 0xc)) && (*(int *)(puVar5 + 4) != 0)) {
    return;
  }
  pcVar2 = *(char **)(this + 0xf8);
  if (pcVar2 == (char *)0x0) {
    pcVar2 = "";
  }
  piVar3 = (int *)CGlobalEntityList::FindEntityByName
                            ((CGlobalEntityList *)gEntList,(CBaseEntity *)0x0,pcVar2,
                             (CBaseEntity *)0x0,(CBaseEntity *)0x0,(CBaseEntity *)0x0,
                             (IEntityFindFilter *)0x0);
  if (piVar3 == (int *)0x0) {
    puVar6 = &DAT_00d539c2;
    if (*(undefined1 **)(this + 0xf8) != (undefined1 *)0x0) {
      puVar6 = *(undefined1 **)(this + 0xf8);
    }
    Msg("Can\'t find target of train %s\n",puVar6);
  }
  else {
    *(int *)(this + 0xf8) = piVar3[0x3e];
    puVar4 = (undefined4 *)(**(code **)(*piVar3 + 0xc))(piVar3);
    *(undefined4 *)(this + 0x4d0) = *puVar4;
  }
  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)