L L4D2node

SurvivorEscapeFlames::Update

0x0092c430 · 1151 bytes · __thiscall

_ZN20SurvivorEscapeFlames6UpdateEP11SurvivorBotf

Decompiled

undefined (3 params)

/* SurvivorEscapeFlames::Update(SurvivorBot*, float) */

SurvivorEscapeFlames * __thiscall
SurvivorEscapeFlames::Update(SurvivorEscapeFlames *this,SurvivorBot *param_1,float param_2)

{
  float fVar1;
  float fVar2;
  float fVar3;
  float fVar4;
  float fVar5;
  float fVar6;
  char cVar7;
  int iVar8;
  int *piVar9;
  SurvivorLegsApproach *this_00;
  undefined4 *puVar10;
  SurvivorLegsWait *this_01;
  float *pfVar11;
  longdouble lVar12;
  
  iVar8 = (**(code **)(*(int *)param_2 + 0x52c))(param_2);
  if (iVar8 == 0) {
    *(undefined4 *)this = 3;
    *(undefined4 *)(this + 4) = 0;
    *(char **)(this + 8) = "No last known area!";
    return this;
  }
  if ((*(float *)(param_1 + 0x3c) <= 0.0) ||
     (lVar12 = (longdouble)IntervalTimer::Now(), 0.75 <= (float)lVar12 - *(float *)(param_1 + 0x3c))
     ) {
    piVar9 = (int *)(**(code **)(*(int *)param_2 + 0x9a0))(param_2);
    cVar7 = (**(code **)(*piVar9 + 0x174))(piVar9);
    if (cVar7 != '\0') {
      this_01 = ::operator_new(0x44);
                    /* try { // try from 0092c67a to 0092c67e has its CatchHandler @ 0092c933 */
      SurvivorLegsWait::SurvivorLegsWait(this_01,0.0);
      iVar8 = (**(code **)(*(int *)param_2 + 0x9a8))(param_2);
      piVar9 = *(int **)(iVar8 + 0x20 + *(int *)(iVar8 + 0x60) * 4);
      puVar10 = ::operator_new(0x38);
      *puVar10 = &PTR__Behavior_00d00308;
      puVar10[1] = &PTR__Behavior_00d003d0;
                    /* try { // try from 0092c6c7 to 0092c6cb has its CatchHandler @ 0092c914 */
      CFmtStrN<32>::CFmtStrN((CFmtStrN<32> *)(puVar10 + 3),"%s",&DAT_00d539c2);
      puVar10[2] = this_01;
      *(undefined4 **)(iVar8 + 0x20 + *(int *)(iVar8 + 0x60) * 4) = puVar10;
      if (piVar9 != (int *)0x0) {
        (**(code **)(*piVar9 + 4))(piVar9);
      }
    }
    if ((*(float *)(param_1 + 0x3c) <= 0.0) ||
       (lVar12 = (longdouble)IntervalTimer::Now(), 3.0 < (float)lVar12 - *(float *)(param_1 + 0x3c))
       ) {
      *(undefined4 *)this = 3;
      *(undefined4 *)(this + 4) = 0;
      *(char **)(this + 8) = "No longer in a damaging area";
      return this;
    }
  }
  else {
    piVar9 = (int *)(**(code **)(*(int *)param_2 + 0x9a0))(param_2);
    cVar7 = (**(code **)(*piVar9 + 0x174))(piVar9);
    if ((((cVar7 == '\0') || (*(int *)(param_1 + 0x4c) == 0)) ||
        (*(int *)(gpGlobals + 0x18) <= *(int *)(*(int *)(param_1 + 0x4c) + 0x70))) ||
       (*(int *)(gpGlobals + 0x18) <= *(int *)(iVar8 + 0x70))) {
      lVar12 = (longdouble)CountdownTimer::Now();
      if (*(float *)(param_1 + 0x48) <= (float)lVar12) {
        iVar8 = FindSafeArea((SurvivorEscapeFlames *)param_1,(SurvivorBot *)param_2);
        *(int *)(param_1 + 0x4c) = iVar8;
        if (iVar8 == 0) {
          piVar9 = (int *)(**(code **)(*(int *)param_2 + 0x9a0))(param_2);
          pfVar11 = (float *)(**(code **)(*piVar9 + 0x14c))(piVar9);
          fVar1 = *pfVar11;
          fVar2 = pfVar11[1];
          fVar3 = pfVar11[2];
          piVar9 = (int *)(**(code **)(*(int *)param_2 + 0x9a0))(param_2);
          pfVar11 = (float *)(**(code **)(*piVar9 + 300))(piVar9);
          fVar4 = *pfVar11;
          fVar5 = pfVar11[2];
          fVar6 = pfVar11[1];
          puVar10 = ::operator_new(0x70);
          puVar10[8] = 0;
          puVar10[9] = 0;
          puVar10[10] = 0;
          puVar10[3] = 0;
          puVar10[4] = 0;
          puVar10[5] = 0;
          puVar10[6] = 0;
          puVar10[7] = 0;
          puVar10[2] = 0;
          *(undefined1 *)(puVar10 + 0xc) = 0;
          *(undefined1 *)((int)puVar10 + 0x31) = 0;
          puVar10[0xb] = 0;
          *puVar10 = &PTR__BehaviorBackUp_00d05868;
          puVar10[1] = &PTR__BehaviorBackUp_00d059cc;
          puVar10[0xd] = &PTR_NetworkStateChanged_00c0b6e0;
          puVar10[0xe] = 0;
          puVar10[0xf] = 0xbf800000;
          puVar10[0x10] = &PTR_NetworkStateChanged_00c0b6e0;
          puVar10[0x11] = 0;
          puVar10[0x12] = 0xbf800000;
          puVar10[0x13] = &PTR_NetworkStateChanged_00c0b6e0;
          puVar10[0x14] = 0;
          puVar10[0x15] = 0xbf800000;
          puVar10[0x19] = fVar1 * 10.0 + fVar4;
          puVar10[0x1a] = fVar2 * 10.0 + fVar6;
          puVar10[0x1b] = fVar3 * 10.0 + fVar5;
          *(undefined4 *)this = 1;
          *(undefined4 **)(this + 4) = puVar10;
          *(char **)(this + 8) = "Can\'t find a way out of the fire, so I\'m backing up!";
          return this;
        }
        this_00 = ::operator_new(0x9050);
                    /* try { // try from 0092c512 to 0092c516 has its CatchHandler @ 0092c8ff */
        SurvivorLegsApproach::SurvivorLegsApproach(this_00,(Vector *)(iVar8 + 0x2c));
        iVar8 = (**(code **)(*(int *)param_2 + 0x9a8))(param_2);
        piVar9 = *(int **)(iVar8 + 0x20 + *(int *)(iVar8 + 0x60) * 4);
        puVar10 = ::operator_new(0x38);
        *puVar10 = &PTR__Behavior_00d00308;
        puVar10[1] = &PTR__Behavior_00d003d0;
                    /* try { // try from 0092c560 to 0092c564 has its CatchHandler @ 0092c8dd */
        CFmtStrN<32>::CFmtStrN((CFmtStrN<32> *)(puVar10 + 3),"%s",&DAT_00d539c2);
        puVar10[2] = this_00;
        *(undefined4 **)(iVar8 + 0x20 + *(int *)(iVar8 + 0x60) * 4) = puVar10;
        if (piVar9 != (int *)0x0) {
          (**(code **)(*piVar9 + 4))(piVar9);
        }
        lVar12 = (longdouble)CountdownTimer::Now();
        if ((float)lVar12 + 1.0 != *(float *)(param_1 + 0x48)) {
          (**(code **)(*(int *)(param_1 + 0x40) + 4))(param_1 + 0x40,param_1 + 0x48);
          *(float *)(param_1 + 0x48) = (float)lVar12 + 1.0;
        }
        if (*(float *)(param_1 + 0x44) != 1.0) {
          (**(code **)(*(int *)(param_1 + 0x40) + 4))(param_1 + 0x40,param_1 + 0x44);
          *(undefined4 *)(param_1 + 0x44) = 0x3f800000;
        }
      }
    }
  }
  *(undefined4 *)this = 0;
  *(undefined4 *)(this + 4) = 0;
  *(undefined4 *)(this + 8) = 0;
  return this;
}

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)