L L4D2node

CFishPool::FireGameEvent

0x006a52d0 · 495 bytes · __thiscall

_ZN9CFishPool13FireGameEventEP10IGameEvent

Decompiled

undefined (2 params)

/* CFishPool::FireGameEvent(IGameEvent*) */

void __thiscall CFishPool::FireGameEvent(CFishPool *this,IGameEvent *param_1)

{
  uint uVar1;
  int iVar2;
  CBaseEntity *this_00;
  char *pcVar3;
  undefined *puVar4;
  CBaseEntity *this_01;
  CFish *this_02;
  float fVar5;
  int local_24;
  int local_20;
  
  iVar2 = (**(code **)(*(int *)param_1 + 0x1c))(param_1,"userid",0);
  this_00 = (CBaseEntity *)UTIL_PlayerByUserId(iVar2);
  pcVar3 = (char *)(**(code **)(*(int *)param_1 + 8))(param_1);
  iVar2 = _V_strcmp("player_footstep",pcVar3);
  fVar5 = 75.0;
  if (iVar2 != 0) {
    fVar5 = 500.0;
  }
  if (*(int *)(this + 0x46c) < 1) {
    return;
  }
  local_20 = 0;
  do {
    while (this_00 != (CBaseEntity *)0x0) {
      local_24 = local_20 * 4;
      uVar1 = *(uint *)(*(int *)(this + 0x460) + local_20 * 4);
      this_01 = (CBaseEntity *)0x0;
      if (((uVar1 != 0xffffffff) &&
          (puVar4 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar4 != (undefined *)0xfffffffc)) &&
         (*(uint *)(puVar4 + 8) == uVar1 >> 0xc)) {
        this_01 = *(CBaseEntity **)(puVar4 + 4);
      }
      if (((byte)this_01[0x14d] & 8) != 0) {
        CBaseEntity::CalcAbsolutePosition(this_01);
      }
      if (((byte)this_00[0x14d] & 8) != 0) {
        CBaseEntity::CalcAbsolutePosition(this_00);
      }
      if ((*(float *)(this_00 + 0x2e0) - *(float *)(this_01 + 0x2e0)) *
          (*(float *)(this_00 + 0x2e0) - *(float *)(this_01 + 0x2e0)) +
          (*(float *)(this_00 + 0x2e8) - *(float *)(this_01 + 0x2e8)) *
          (*(float *)(this_00 + 0x2e8) - *(float *)(this_01 + 0x2e8)) +
          (*(float *)(this_00 + 0x2e4) - *(float *)(this_01 + 0x2e4)) *
          (*(float *)(this_00 + 0x2e4) - *(float *)(this_01 + 0x2e4)) <= fVar5 * fVar5)
      goto LAB_006a5417;
      local_20 = local_20 + 1;
      if (*(int *)(this + 0x46c) <= local_20) {
        return;
      }
    }
    local_24 = local_20 << 2;
LAB_006a5417:
    uVar1 = *(uint *)(*(int *)(this + 0x460) + local_24);
    this_02 = (CFish *)0x0;
    if (((uVar1 != 0xffffffff) &&
        (puVar4 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar4 != (undefined *)0xfffffffc)) &&
       (*(uint *)(puVar4 + 8) == uVar1 >> 0xc)) {
      this_02 = *(CFish **)(puVar4 + 4);
    }
    CFish::Panic(this_02);
    local_20 = local_20 + 1;
    if (*(int *)(this + 0x46c) <= local_20) {
      return;
    }
  } while( true );
}

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)