L L4D2node

AI_Response::GetRespeakDelay

0x005a87c0 · 517 bytes · __thiscall

_ZNK11AI_Response15GetRespeakDelayEv

Decompiled

undefined (1 param)

/* AI_Response::GetRespeakDelay() const */

longdouble __thiscall AI_Response::GetRespeakDelay(AI_Response *this)

{
  ushort uVar1;
  byte bVar2;
  longdouble lVar3;
  float local_14;
  float local_10;
  
  local_14 = 0.0;
  if (((byte)this[0x96] & 8) == 0) {
    return (longdouble)0.0;
  }
  uVar1 = *(ushort *)(this + 0x8c);
  if ((uVar1 & 0x7fff) == 0x7c00) {
    local_14 = 65504.0;
    if ((short)uVar1 < 0) {
      local_14 = -65504.0;
    }
  }
  else {
    bVar2 = (byte)(uVar1 >> 8);
    if ((bVar2 & 0x7c) == 0x7c) {
      if ((uVar1 & 0x3ff) == 0) goto LAB_005a882b;
    }
    else if (((uVar1 & 0x7c00) == 0) && ((uVar1 & 0x3ff) != 0)) {
      local_14 = 1.0;
      if ((short)uVar1 < 0) {
        local_14 = -1.0;
      }
      local_14 = ((float)(uVar1 & 0x3ff) + 0.0) * 5.9604645e-08 * local_14;
    }
    else {
LAB_005a882b:
      local_14 = (float)((uVar1 & 0x3ff) << 0xd | (uint)(bVar2 >> 7) << 0x1f |
                        (uint)((uVar1 >> 10 & 0x1f) != 0) * ((uVar1 >> 10 & 0x1f) + 0x70) * 0x800000
                        );
    }
  }
  uVar1 = *(ushort *)(this + 0x8e);
  if ((uVar1 & 0x7fff) == 0x7c00) {
    local_10 = 65504.0;
    if ((short)uVar1 < 0) {
      local_10 = -65504.0;
    }
  }
  else {
    bVar2 = (byte)(uVar1 >> 8);
    if ((bVar2 & 0x7c) == 0x7c) {
      local_10 = 0.0;
      if ((uVar1 & 0x3ff) != 0) goto LAB_005a891f;
    }
    else if (((uVar1 & 0x7c00) == 0) && ((uVar1 & 0x3ff) != 0)) {
      local_10 = 1.0;
      if ((short)uVar1 < 0) {
        local_10 = -1.0;
      }
      local_10 = ((float)(uVar1 & 0x3ff) + 0.0) * 5.9604645e-08 * local_10;
      goto LAB_005a891f;
    }
    local_10 = (float)((uVar1 & 0x3ff) << 0xd | (uint)(bVar2 >> 7) << 0x1f |
                      (uint)((uVar1 >> 10 & 0x1f) != 0) * ((uVar1 >> 10 & 0x1f) + 0x70) * 0x800000);
  }
LAB_005a891f:
  lVar3 = (longdouble)RandomInterval((interval_t *)&local_14);
  return (longdouble)(float)lVar3;
}

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)