L L4D2node

Witch::SetHarasser

0x00a483f0 · 366 bytes · __thiscall

_ZN5Witch11SetHarasserEP11CBaseEntity

Decompiled

undefined (2 params)

/* Witch::SetHarasser(CBaseEntity*) */

void __thiscall Witch::SetHarasser(Witch *this,CBaseEntity *param_1)

{
  uint uVar1;
  code *pcVar2;
  char cVar3;
  undefined4 *puVar4;
  int *piVar5;
  undefined4 uVar6;
  int iVar7;
  CBaseEntity *pCVar8;
  undefined *puVar9;
  bool local_1d;
  
  local_1d = true;
  uVar1 = *(uint *)(this + 0x1da8);
  if (((uVar1 != 0xffffffff) &&
      (puVar9 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar9 != (undefined *)0xfffffffc)) &&
     (*(uint *)(puVar9 + 8) == uVar1 >> 0xc)) {
    local_1d = *(int *)(puVar9 + 4) == 0;
  }
  if (param_1 != (CBaseEntity *)0x0) {
    puVar4 = (undefined4 *)(**(code **)(*(int *)param_1 + 0xc))(param_1);
    *(undefined4 *)(this + 0x1da8) = *puVar4;
    cVar3 = (**(code **)(*(int *)param_1 + 0x16c))(param_1);
    if (cVar3 != '\0') {
      piVar5 = (int *)(**(code **)(*gameeventmanager + 0x1c))
                                (gameeventmanager,"witch_harasser_set",0,0);
      if (piVar5 != (int *)0x0) {
        pcVar2 = *(code **)(*piVar5 + 0x30);
        cVar3 = (**(code **)(*(int *)param_1 + 0x16c))(param_1);
        pCVar8 = (CBaseEntity *)0x0;
        if (cVar3 != '\0') {
          pCVar8 = param_1;
        }
        uVar6 = (**(code **)(*engine + 0x40))(engine,*(undefined4 *)(pCVar8 + 0x30));
        (*pcVar2)(piVar5,"userid",uVar6);
        if (*(int *)(this + 0x30) == 0) {
          iVar7 = 0;
        }
        else {
          iVar7 = *(int *)(this + 0x30) - *(int *)(gpGlobals + 0x58) >> 4;
        }
        (**(code **)(*piVar5 + 0x30))(piVar5,"witchid",iVar7);
        (**(code **)(*piVar5 + 0x2c))(piVar5,"first",local_1d);
        (**(code **)(*gameeventmanager + 0x20))(gameeventmanager,piVar5,0);
      }
    }
    return;
  }
  *(undefined4 *)(this + 0x1da8) = 0xffffffff;
  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)