L L4D2node

CTerrorPlayer::OnStartCarryingVictim

0x009bee60 · 431 bytes · __thiscall

_ZN13CTerrorPlayer21OnStartCarryingVictimEPS_

Decompiled

undefined (2 params)

/* CTerrorPlayer::OnStartCarryingVictim(CTerrorPlayer*) */

void __thiscall CTerrorPlayer::OnStartCarryingVictim(CTerrorPlayer *this,CTerrorPlayer *param_1)

{
  code *pcVar1;
  uint uVar2;
  CBaseEdict *this_00;
  int *piVar3;
  undefined4 uVar4;
  uint *puVar5;
  undefined *puVar6;
  int iVar7;
  uint uVar8;
  int iVar9;
  
  piVar3 = (int *)(**(code **)(*gameeventmanager + 0x1c))
                            (gameeventmanager,"charger_carry_start",0,0);
  if (piVar3 == (int *)0x0) {
    if (param_1 == (CTerrorPlayer *)0x0) {
      uVar8 = 0xffffffff;
      iVar9 = 0;
      goto LAB_009bef45;
    }
  }
  else {
    pcVar1 = *(code **)(*piVar3 + 0x30);
    uVar4 = (**(code **)(*engine + 0x40))(engine,*(undefined4 *)(this + 0x30));
    (*pcVar1)(piVar3,"userid",uVar4);
    pcVar1 = *(code **)(*piVar3 + 0x30);
    uVar4 = (**(code **)(*engine + 0x40))(engine,*(undefined4 *)(param_1 + 0x30));
    (*pcVar1)(piVar3,"victim",uVar4);
    (**(code **)(*gameeventmanager + 0x20))(gameeventmanager,piVar3,0);
  }
  puVar5 = (uint *)(**(code **)(*(int *)param_1 + 0xc))(param_1);
  uVar8 = *puVar5;
  if (((uVar8 == 0xffffffff) ||
      (puVar6 = g_pEntityList + (uVar8 & 0xfff) * 0x10, puVar6 == (undefined *)0xfffffffc)) ||
     (*(uint *)(puVar6 + 8) != uVar8 >> 0xc)) {
    iVar9 = 0;
  }
  else {
    iVar9 = *(int *)(puVar6 + 4);
  }
LAB_009bef45:
  uVar2 = *(uint *)(this + 0x2a48);
  if (((uVar2 == 0xffffffff) ||
      (puVar6 = g_pEntityList + (uVar2 & 0xfff) * 0x10, puVar6 == (undefined *)0xfffffffc)) ||
     (*(uint *)(puVar6 + 8) != uVar2 >> 0xc)) {
    iVar7 = 0;
  }
  else {
    iVar7 = *(int *)(puVar6 + 4);
  }
  if (iVar9 != iVar7) {
    if (this[0x6c] == (CTerrorPlayer)0x0) {
      this_00 = *(CBaseEdict **)(this + 0x30);
      if (this_00 != (CBaseEdict *)0x0) {
        *(uint *)this_00 = *(uint *)this_00 | 0x101;
        iVar9 = CBaseEdict::GetChangeAccessor(this_00);
        *(undefined2 *)(iVar9 + 2) = 0;
      }
      *(uint *)(this + 0x2a48) = uVar8;
    }
    else {
      this[0x70] = (CTerrorPlayer)((byte)this[0x70] | 1);
      *(uint *)(this + 0x2a48) = uVar8;
    }
  }
  OnStartBeingCarried(param_1,this);
  CBasePlayer::RumbleEffect((CBasePlayer *)this,'&','\0','\x04');
  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)