L L4D2node

CPlayerPickupController::Use

0x004ee290 · 650 bytes · __cdecl

_ZN23CPlayerPickupController3UseEP11CBaseEntityS1_8USE_TYPEf

Decompiled

undefined (4 params)

/* CPlayerPickupController::Use(CBaseEntity*, CBaseEntity*, USE_TYPE, float) */

void CPlayerPickupController::Use
               (CPlayerPickupController *param_1,int *param_2,undefined4 param_3,int param_4)

{
  uint uVar1;
  int *piVar2;
  char cVar3;
  int iVar4;
  int iVar5;
  int iVar6;
  undefined *puVar7;
  longdouble lVar8;
  float fVar9;
  float local_34;
  float local_30;
  float local_2c;
  float local_28;
  float local_24;
  float local_20;
  
  if ((param_2 == (int *)0x0) || (cVar3 = (**(code **)(*param_2 + 0x16c))(param_2), cVar3 == '\0'))
  {
    if (*(int *)(param_1 + 0x24c4) != 0) {
      return;
    }
  }
  else if (*(int **)(param_1 + 0x24c4) != param_2) {
    return;
  }
  uVar1 = *(uint *)(param_1 + 0x24a8);
  if ((((uVar1 != 0xffffffff) &&
       (puVar7 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar7 != (undefined *)0xfffffffc)) &&
      (*(uint *)(puVar7 + 8) == uVar1 >> 0xc)) &&
     ((iVar4 = *(int *)(puVar7 + 4), param_4 != 0 && (iVar4 != 0)))) {
    lVar8 = (longdouble)CGrabController::ComputeError((CGrabController *)(param_1 + 0x440));
    if (((float)lVar8 <= 12.0) &&
       ((piVar2 = *(int **)(iVar4 + 0x238), piVar2 == (int *)0x0 ||
        (cVar3 = (**(code **)(*piVar2 + 0x2c))(piVar2), cVar3 != '\0')))) {
      uVar1 = *(uint *)(*(CBasePlayer **)(param_1 + 0x24c4) + 0x1cb0);
      if ((uVar1 & 1) == 0) {
        if ((uVar1 & 0x800) == 0) {
          if (param_4 == 2) {
            CGrabController::UpdateObject
                      ((CGrabController *)(param_1 + 0x440),*(CBasePlayer **)(param_1 + 0x24c4),12.0
                      );
          }
        }
        else {
          Shutdown(param_1,true);
        }
      }
      else {
        Shutdown(param_1,true);
        CBasePlayer::EyeVectors
                  (*(CBasePlayer **)(param_1 + 0x24c4),(Vector *)&local_34,(Vector *)0x0,
                   (Vector *)0x0);
        lVar8 = (longdouble)(**(code **)(*piVar2 + 0x78))(piVar2);
        local_20 = 4.0;
        if ((float)lVar8 <= 15.0) {
          lVar8 = (longdouble)(**(code **)(*piVar2 + 0x78))(piVar2);
          local_20 = 0.5;
          if (0.5 <= (float)lVar8) {
            lVar8 = (longdouble)(**(code **)(*piVar2 + 0x78))(piVar2);
            local_20 = ((float)lVar8 + -0.5) * 0.2413793 + 0.5;
          }
        }
        fVar9 = local_20 * *(float *)(player_throwforce._28_4_ + 0x2c);
        local_34 = local_34 * fVar9;
        local_30 = local_30 * fVar9;
        local_2c = fVar9 * local_2c;
        (**(code **)(*piVar2 + 0xf4))(piVar2,(Vector *)&local_34);
        iVar4 = rand();
        iVar5 = rand();
        iVar6 = rand();
        local_28 = ((float)iVar4 * 0.0006103702 + -10.0) * local_20;
        local_24 = ((float)iVar5 * 0.0006103702 + -10.0) * local_20;
        local_20 = ((float)iVar6 * 0.0006103702 + -10.0) * local_20;
        (**(code **)(*piVar2 + 0xfc))(piVar2,&local_28);
      }
      return;
    }
  }
  Shutdown(param_1,false);
  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)