L L4D2node

CTerrorPlayer::StopDragging

0x009c1250 · 495 bytes · __thiscall

_ZN13CTerrorPlayer12StopDraggingEv

Decompiled

undefined (1 param)

/* CTerrorPlayer::StopDragging() */

void __thiscall CTerrorPlayer::StopDragging(CTerrorPlayer *this)

{
  uint uVar1;
  code *pcVar2;
  CBaseEdict *this_00;
  int *piVar3;
  undefined4 uVar4;
  int iVar5;
  int iVar6;
  CTerrorPlayer *this_01;
  undefined *puVar7;
  
  uVar1 = *(uint *)(this + 0x2d64);
  if ((((uVar1 != 0xffffffff) &&
       (puVar7 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar7 != (undefined *)0xfffffffc)) &&
      (*(uint *)(puVar7 + 8) == uVar1 >> 0xc)) && (*(int *)(puVar7 + 4) != 0)) {
    piVar3 = (int *)(**(code **)(*gameeventmanager + 0x1c))(gameeventmanager,"drag_end",0,0);
    if (piVar3 != (int *)0x0) {
      pcVar2 = *(code **)(*piVar3 + 0x30);
      uVar4 = (**(code **)(*engine + 0x40))(engine,*(undefined4 *)(this + 0x30));
      (*pcVar2)(piVar3,"userid",uVar4);
      iVar6 = 0;
      pcVar2 = *(code **)(*piVar3 + 0x30);
      uVar1 = *(uint *)(this + 0x2d64);
      if (((uVar1 != 0xffffffff) &&
          (puVar7 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar7 != (undefined *)0xfffffffc)) &&
         (*(uint *)(puVar7 + 8) == uVar1 >> 0xc)) {
        iVar6 = *(int *)(puVar7 + 4);
      }
      uVar4 = (**(code **)(*engine + 0x40))(engine,*(undefined4 *)(iVar6 + 0x30));
      (*pcVar2)(piVar3,"subject",uVar4);
      (**(code **)(*gameeventmanager + 0x20))(gameeventmanager,piVar3,0);
    }
    uVar1 = *(uint *)(this + 0x2d64);
    this_01 = (CTerrorPlayer *)0x0;
    if (((uVar1 != 0xffffffff) &&
        (puVar7 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar7 != (undefined *)0xfffffffc)) &&
       (*(uint *)(puVar7 + 8) == uVar1 >> 0xc)) {
      this_01 = *(CTerrorPlayer **)(puVar7 + 4);
    }
    StopBeingDragged(this_01);
    if ((g_pEntityList == (undefined *)0xfffffffc) || (*(int *)(g_pEntityList + 8) != 0)) {
      iVar6 = 0;
    }
    else {
      iVar6 = *(int *)(g_pEntityList + 4);
    }
    uVar1 = *(uint *)(this + 0x2d64);
    if (((uVar1 == 0xffffffff) ||
        (puVar7 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar7 == (undefined *)0xfffffffc)) ||
       (*(uint *)(puVar7 + 8) != uVar1 >> 0xc)) {
      iVar5 = 0;
    }
    else {
      iVar5 = *(int *)(puVar7 + 4);
    }
    if (iVar6 != iVar5) {
      if (this[0x6c] == (CTerrorPlayer)0x0) {
        this_00 = *(CBaseEdict **)(this + 0x30);
        if (this_00 != (CBaseEdict *)0x0) {
          *(uint *)this_00 = *(uint *)this_00 | 0x101;
          iVar6 = CBaseEdict::GetChangeAccessor(this_00);
          *(undefined2 *)(iVar6 + 2) = 0;
        }
      }
      else {
        this[0x70] = (CTerrorPlayer)((byte)this[0x70] | 1);
      }
      *(undefined4 *)(this + 0x2d64) = 0;
      return;
    }
  }
  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)