L L4D2node

jockey

0x004f0b70 · 437 bytes · __cdecl

_ZL6jockeyRK8CCommand

Decompiled

undefined (1 param)

/* jockey(CCommand const&) */

void jockey(CCommand *param_1)

{
  uint uVar1;
  uint uVar2;
  CBaseEdict *pCVar3;
  CBasePlayer *pCVar4;
  CBaseEntity *this;
  int iVar5;
  uint *puVar6;
  undefined *puVar7;
  int iVar8;
  uint local_20;
  
  pCVar4 = (CBasePlayer *)UTIL_GetCommandClient();
  this = (CBaseEntity *)FindPickerEntityClass(pCVar4,"player");
  if (this != (CBaseEntity *)0x0) {
    iVar5 = CBaseEntity::GetTeamNumber(this);
    if (iVar5 == 2) {
      if (pCVar4 == (CBasePlayer *)0x0) {
        local_20 = 0xffffffff;
        iVar5 = 0;
      }
      else {
        puVar6 = (uint *)(**(code **)(*(int *)pCVar4 + 0xc))(pCVar4);
        local_20 = *puVar6;
        if (((local_20 == 0xffffffff) ||
            (puVar7 = g_pEntityList + (local_20 & 0xfff) * 0x10, puVar7 == (undefined *)0xfffffffc))
           || (*(uint *)(puVar7 + 8) != local_20 >> 0xc)) {
          iVar5 = 0;
        }
        else {
          iVar5 = *(int *)(puVar7 + 4);
        }
      }
      uVar1 = *(uint *)(this + 0x3ee0);
      if (((uVar1 == 0xffffffff) ||
          (puVar7 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar7 == (undefined *)0xfffffffc)) ||
         (*(uint *)(puVar7 + 8) != uVar1 >> 0xc)) {
        iVar8 = 0;
      }
      else {
        iVar8 = *(int *)(puVar7 + 4);
      }
      if (iVar5 != iVar8) {
        if (this[0x6c] == (CBaseEntity)0x0) {
          pCVar3 = *(CBaseEdict **)(this + 0x30);
          if (pCVar3 != (CBaseEdict *)0x0) {
            *(uint *)pCVar3 = *(uint *)pCVar3 | 0x101;
            iVar5 = CBaseEdict::GetChangeAccessor(pCVar3);
            *(undefined2 *)(iVar5 + 2) = 0;
          }
        }
        else {
          this[0x70] = (CBaseEntity)((byte)this[0x70] | 1);
        }
        *(uint *)(this + 0x3ee0) = local_20;
      }
      puVar6 = (uint *)(**(code **)(*(int *)this + 0xc))(this);
      uVar1 = *puVar6;
      if (((uVar1 == 0xffffffff) ||
          (puVar7 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar7 == (undefined *)0xfffffffc)) ||
         (*(uint *)(puVar7 + 8) != uVar1 >> 0xc)) {
        iVar5 = 0;
      }
      else {
        iVar5 = *(int *)(puVar7 + 4);
      }
      uVar2 = *(uint *)(pCVar4 + 0x3edc);
      if (((uVar2 == 0xffffffff) ||
          (puVar7 = g_pEntityList + (uVar2 & 0xfff) * 0x10, puVar7 == (undefined *)0xfffffffc)) ||
         (*(uint *)(puVar7 + 8) != uVar2 >> 0xc)) {
        iVar8 = 0;
      }
      else {
        iVar8 = *(int *)(puVar7 + 4);
      }
      if (iVar5 != iVar8) {
        if (pCVar4[0x6c] == (CBasePlayer)0x0) {
          pCVar3 = *(CBaseEdict **)(pCVar4 + 0x30);
          if (pCVar3 != (CBaseEdict *)0x0) {
            *(uint *)pCVar3 = *(uint *)pCVar3 | 0x101;
            iVar5 = CBaseEdict::GetChangeAccessor(pCVar3);
            *(undefined2 *)(iVar5 + 2) = 0;
          }
        }
        else {
          pCVar4[0x70] = (CBasePlayer)((byte)pCVar4[0x70] | 1);
        }
        *(uint *)(pCVar4 + 0x3edc) = uVar1;
        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)