L L4D2node

InfectedAlert::LookTowardsDisturbance

0x00a19c70 · 696 bytes · __thiscall

_ZN13InfectedAlert22LookTowardsDisturbanceEP8Infected

Decompiled

undefined (2 params)

/* InfectedAlert::LookTowardsDisturbance(Infected*) */

undefined4 __thiscall InfectedAlert::LookTowardsDisturbance(InfectedAlert *this,Infected *param_1)

{
  float fVar1;
  char cVar2;
  int *piVar3;
  int *piVar4;
  int iVar5;
  code *pcVar6;
  longdouble lVar7;
  float fVar8;
  float local_34;
  float local_30;
  float local_2c;
  float local_28;
  float local_24;
  float local_20;
  
  piVar3 = (int *)(**(code **)(*(int *)param_1 + 0x594))(param_1);
  if (((byte)param_1[0x14d] & 8) != 0) {
    CBaseEntity::CalcAbsolutePosition((CBaseEntity *)param_1);
  }
  local_2c = 0.0;
  local_34 = *(float *)(this + 0x34) - *(float *)(param_1 + 0x2e0);
  local_30 = *(float *)(this + 0x38) - *(float *)(param_1 + 0x2e4);
  VectorNormalize((Vector *)&local_34);
  piVar4 = (int *)(**(code **)(*(int *)param_1 + 0x570))(param_1);
  (**(code **)(*piVar4 + 1000))(&local_28,piVar4);
  fVar8 = local_24 * local_30 + local_28 * local_34 + local_20 * local_2c;
  if (fVar8 <= 0.7071) {
    if (-0.7071 <= fVar8) {
      pcVar6 = *(code **)(*piVar3 + 0xd8);
      if (local_28 * local_30 - local_34 * local_24 <= 0.7071) {
        iVar5 = (*(int *)(this + 0x40) != 1) + 0x23c;
      }
      else {
        iVar5 = (*(int *)(this + 0x40) != 1) + 0x23a;
      }
    }
    else {
      pcVar6 = *(code **)(*piVar3 + 0xd8);
      iVar5 = (*(int *)(this + 0x40) != 1) + 0x238;
    }
  }
  else {
    pcVar6 = *(code **)(*piVar3 + 0xd8);
    iVar5 = (*(int *)(this + 0x40) != 1) + 0x236;
  }
  cVar2 = (*pcVar6)(piVar3,iVar5,0x11);
  if (cVar2 != '\0') {
    lVar7 = (longdouble)RandomFloat(0x3f800000,0x40000000);
    fVar8 = (float)lVar7;
    lVar7 = (longdouble)CountdownTimer::Now();
    if ((float)lVar7 + fVar8 == *(float *)(this + 0x70)) {
      fVar1 = *(float *)(this + 0x6c);
    }
    else {
      (**(code **)(*(int *)(this + 0x68) + 4))(this + 0x68,this + 0x70);
      fVar1 = *(float *)(this + 0x6c);
      *(float *)(this + 0x70) = (float)lVar7 + fVar8;
    }
    if (fVar8 != fVar1) {
      (**(code **)(*(int *)(this + 0x68) + 4))(this + 0x68,this + 0x6c);
      *(float *)(this + 0x6c) = fVar8;
    }
    lVar7 = (longdouble)RandomFloat(0x40a00000,0x41700000);
    fVar8 = (float)lVar7;
    lVar7 = (longdouble)CountdownTimer::Now();
    if ((float)lVar7 + fVar8 == *(float *)(this + 0x4c)) {
      fVar1 = *(float *)(this + 0x48);
    }
    else {
      (**(code **)(*(int *)(this + 0x44) + 4))(this + 0x44,this + 0x4c);
      fVar1 = *(float *)(this + 0x48);
      *(float *)(this + 0x4c) = (float)lVar7 + fVar8;
    }
    if (fVar8 == fVar1) {
      return 1;
    }
    (**(code **)(*(int *)(this + 0x44) + 4))(this + 0x44,this + 0x48);
    *(float *)(this + 0x48) = fVar8;
    return 1;
  }
  return 0;
}

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)