L L4D2node

CAI_Expresser::GetResponseDuration

0x005d10e0 · 299 bytes · __thiscall

_ZN13CAI_Expresser19GetResponseDurationEP11AI_Response

Decompiled

undefined (2 params)

/* CAI_Expresser::GetResponseDuration(AI_Response*) */

longdouble __thiscall CAI_Expresser::GetResponseDuration(CAI_Expresser *this,AI_Response *param_1)

{
  AI_Response AVar1;
  uint uVar2;
  char *pcVar3;
  undefined *puVar4;
  int *piVar5;
  undefined1 *puVar6;
  int in_GS_OFFSET;
  longdouble lVar7;
  float fVar8;
  char *local_130;
  char local_120 [256];
  int local_20;
  
  puVar6 = &stack0xfffffeb4;
  local_20 = *(int *)(in_GS_OFFSET + 0x14);
  AI_Response::GetResponse(param_1,local_120,0x100);
  AVar1 = *param_1;
  if (AVar1 == (AI_Response)0x2) {
    fVar8 = 999.0;
    goto LAB_005d1138;
  }
  if ((byte)AVar1 < 3) {
    if (AVar1 == (AI_Response)0x1) {
      uVar2 = *(uint *)(this + 0x40);
      piVar5 = (int *)0x0;
      if (((uVar2 != 0xffffffff) &&
          (puVar4 = g_pEntityList + (uVar2 & 0xfff) * 0x10, puVar4 != (undefined *)0xfffffffc)) &&
         (*(uint *)(puVar4 + 8) == uVar2 >> 0xc)) {
        piVar5 = *(int **)(puVar4 + 4);
      }
      (**(code **)(*piVar5 + 0x20))();
      puVar6 = &stack0xfffffeb0;
      pcVar3 = "";
      if (local_130 != (char *)0x0) {
        pcVar3 = local_130;
      }
      lVar7 = (longdouble)CBaseEntity::GetSoundDuration(local_120,pcVar3);
      fVar8 = (float)lVar7;
      goto LAB_005d1138;
    }
  }
  else {
    if (AVar1 == (AI_Response)0x3) {
      lVar7 = (longdouble)GetSceneDuration(local_120);
      fVar8 = (float)lVar7;
      puVar6 = &stack0xfffffeb4;
      goto LAB_005d1138;
    }
    fVar8 = 1.0;
    puVar6 = &stack0xfffffeb4;
    if (AVar1 == (AI_Response)0x5) goto LAB_005d1138;
  }
  fVar8 = 0.0;
  puVar6 = &stack0xfffffeb4;
LAB_005d1138:
  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {
    return (longdouble)fVar8;
  }
                    /* WARNING: Subroutine does not return */
  *(undefined **)(puVar6 + -4) = &UNK_005d121c;
  __stack_chk_fail();
}

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)