L L4D2node

z_wound

0x0051ede0 · 257 bytes · __cdecl

_ZL7z_woundRK8CCommand

Decompiled

undefined (1 param)

/* z_wound(CCommand const&) */

void z_wound(CCommand *param_1)

{
  CBaseEdict *this;
  float fVar1;
  float fVar2;
  float fVar3;
  CBasePlayer *pCVar4;
  int *piVar5;
  Infected *this_00;
  char *__nptr;
  long lVar6;
  int iVar7;
  
  pCVar4 = (CBasePlayer *)UTIL_GetCommandClient();
  piVar5 = (int *)FindPickerEntity(pCVar4);
  if (piVar5 != (int *)0x0) {
    this_00 = (Infected *)(**(code **)(*piVar5 + 0x14c))(piVar5);
    if (this_00 != (Infected *)0x0) {
      __nptr = "";
      if (1 < *(int *)param_1) {
        __nptr = *(char **)(param_1 + 0x40c);
      }
      lVar6 = strtol(__nptr,(char **)0x0,10);
      fVar3 = DAT_01053d50;
      fVar2 = DAT_01053d4c;
      fVar1 = vec3_origin;
      if (-2 < lVar6) {
        if (((vec3_origin != *(float *)(this_00 + 0x1cdc)) ||
            (DAT_01053d4c != *(float *)(this_00 + 0x1ce0))) ||
           (DAT_01053d50 != *(float *)(this_00 + 0x1ce4))) {
          if (this_00[0x6c] == (Infected)0x0) {
            this = *(CBaseEdict **)(this_00 + 0x30);
            if (this != (CBaseEdict *)0x0) {
              *(uint *)this = *(uint *)this | 0x101;
              iVar7 = CBaseEdict::GetChangeAccessor(this);
              *(undefined2 *)(iVar7 + 2) = 0;
            }
          }
          else {
            this_00[0x70] = (Infected)((byte)this_00[0x70] | 1);
          }
          *(float *)(this_00 + 0x1cdc) = fVar1;
          *(float *)(this_00 + 0x1ce0) = fVar2;
          *(float *)(this_00 + 0x1ce4) = fVar3;
        }
        Infected::RequestWound(this_00,lVar6);
      }
    }
  }
  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)