L L4D2node

SpitterWaitInAmbush::Update

0x00ad9ea0 · 800 bytes · __thiscall

_ZN19SpitterWaitInAmbush6UpdateEP7Spitterf

Decompiled

undefined (3 params)

/* SpitterWaitInAmbush::Update(Spitter*, float) */

SpitterWaitInAmbush * __thiscall
SpitterWaitInAmbush::Update(SpitterWaitInAmbush *this,Spitter *param_1,float param_2)

{
  char cVar1;
  int *piVar2;
  int *piVar3;
  SpitterAttack *pSVar4;
  CTerrorPlayer *pCVar5;
  int iVar6;
  SpitterPrepareAmbush *this_00;
  longdouble lVar7;
  longdouble lVar8;
  
  piVar2 = (int *)(**(code **)(*(int *)param_2 + 0x9b4))(param_2);
  piVar3 = (int *)CDirectorTacticalServices::GetHighestFlowSurvivor
                            (*(CDirectorTacticalServices **)(TheDirector + 0x628),0);
  (**(code **)(*piVar2 + 0xc4))(piVar2,piVar3,0,0,0,0,1,0x3e800000);
  cVar1 = CDirector::IsFinale(TheDirector);
  if (((cVar1 == '\0') && (cVar1 = (**(code **)(*(int *)param_2 + 0x998))(param_2), cVar1 == '\0'))
     || (cVar1 = CTerrorPlayer::IsCustomAbilityReadyToFire((CTerrorPlayer *)param_2), cVar1 == '\0')
     ) {
    if (*(int *)(param_1 + 0x34) == 0) {
      iVar6 = (**(code **)(*(int *)param_2 + 0x52c))(param_2);
      *(int *)(param_1 + 0x34) = iVar6;
      if (iVar6 == 0) goto LAB_00ada0f3;
    }
    if ((0.0 < *(float *)(param_1 + 0x40)) &&
       (lVar7 = (longdouble)CountdownTimer::Now(), *(float *)(param_1 + 0x40) <= (float)lVar7)) {
      pSVar4 = ::operator_new(0x4858);
                    /* try { // try from 00ad9f8b to 00ad9f8f has its CatchHandler @ 00ada1f2 */
      SpitterAttack::SpitterAttack(pSVar4);
      *(undefined4 *)this = 1;
      *(SpitterAttack **)(this + 4) = pSVar4;
      *(char **)(this + 8) = "I have been hiding for too long.";
      return this;
    }
    pCVar5 = (CTerrorPlayer *)
             CDirectorTacticalServices::GetHighestFlowSurvivor
                       (*(CDirectorTacticalServices **)(TheDirector + 0x628),0);
    if (pCVar5 != (CTerrorPlayer *)0x0) {
      lVar7 = (longdouble)CTerrorPlayer::GetFlowDistance((CTerrorPlayer *)param_2,0);
      lVar8 = (longdouble)CTerrorPlayer::GetFlowDistance(pCVar5,0);
      if ((float)lVar7 < (float)lVar8) {
        pSVar4 = ::operator_new(0x4858);
                    /* try { // try from 00ada057 to 00ada05b has its CatchHandler @ 00ada1ef */
        SpitterAttack::SpitterAttack(pSVar4);
        *(undefined4 *)this = 1;
        *(SpitterAttack **)(this + 4) = pSVar4;
        *(char **)(this + 8) = "Survivors passed me on the flow";
        return this;
      }
    }
    cVar1 = CDirectorTacticalServices::IsVisibleToTeam
                      (*(CDirectorTacticalServices **)(TheDirector + 0x628),(CBaseEntity *)param_2,2
                       ,0,0.0,*(TerrorNavArea **)(param_1 + 0x34));
    if (cVar1 == '\0') {
      if (((piVar3 == (int *)0x0) || (iVar6 = (**(code **)(*piVar3 + 0x52c))(piVar3), iVar6 == 0))
         || ((720.0 < *(float *)(*(int *)(param_1 + 0x34) + 0x154) - *(float *)(iVar6 + 0x154) ||
             (cVar1 = CTerrorPlayer::IsCustomAbilityReadyToFire((CTerrorPlayer *)param_2),
             cVar1 == '\0')))) {
LAB_00ada0f3:
        *(undefined4 *)this = 0;
        *(undefined4 *)(this + 4) = 0;
        *(undefined4 *)(this + 8) = 0;
        return this;
      }
      pSVar4 = ::operator_new(0x4858);
                    /* try { // try from 00ada175 to 00ada179 has its CatchHandler @ 00ada1f6 */
      SpitterAttack::SpitterAttack(pSVar4);
      *(undefined4 *)this = 1;
      *(SpitterAttack **)(this + 4) = pSVar4;
      *(char **)(this + 8) = "Springing my ambush!";
    }
    else {
      cVar1 = CTerrorPlayer::IsCustomAbilityReadyToFire((CTerrorPlayer *)param_2);
      if (cVar1 == '\0') {
        this_00 = ::operator_new(0x481c);
                    /* try { // try from 00ada1c1 to 00ada1c5 has its CatchHandler @ 00ada1ed */
        SpitterPrepareAmbush::SpitterPrepareAmbush(this_00);
        *(undefined4 *)this = 1;
        *(SpitterPrepareAmbush **)(this + 4) = this_00;
        *(char **)(this + 8) = "I can\'t spit so I have to move";
      }
      else {
        pSVar4 = ::operator_new(0x4858);
                    /* try { // try from 00ada139 to 00ada13d has its CatchHandler @ 00ada1db */
        SpitterAttack::SpitterAttack(pSVar4);
        *(undefined4 *)this = 1;
        *(SpitterAttack **)(this + 4) = pSVar4;
        *(char **)(this + 8) = "Survivors revealed my position";
      }
    }
  }
  else {
    pSVar4 = ::operator_new(0x4858);
                    /* try { // try from 00ad9fcd to 00ad9fd1 has its CatchHandler @ 00ada1f4 */
    SpitterAttack::SpitterAttack(pSVar4);
    *(undefined4 *)this = 1;
    *(SpitterAttack **)(this + 4) = pSVar4;
    *(char **)(this + 8) = "Finale started";
  }
  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)