L L4D2node

SurvivorCloseDoor::Update

0x00929520 · 950 bytes · __thiscall

_ZN17SurvivorCloseDoor6UpdateEP11SurvivorBotf

Decompiled

undefined (3 params)

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

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

{
  uint uVar1;
  code *pcVar2;
  char cVar3;
  float *pfVar4;
  undefined *puVar5;
  int *piVar6;
  int iVar7;
  longdouble lVar8;
  float local_40;
  float local_3c;
  float local_38;
  float local_34;
  float local_30;
  float local_2c;
  float local_28;
  float local_24;
  float local_20;
  
  uVar1 = *(uint *)(param_1 + 0x34);
  if ((((uVar1 == 0xffffffff) ||
       (puVar5 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar5 == (undefined *)0xfffffffc)) ||
      (*(uint *)(puVar5 + 8) != uVar1 >> 0xc)) || (*(int *)(puVar5 + 4) == 0)) {
    *(undefined4 *)this = 3;
    *(undefined4 *)(this + 4) = 0;
    *(char **)(this + 8) = "Door was destroyed";
    return this;
  }
  if (*(int *)(&DAT_000015f4 + *(int *)(puVar5 + 4)) == 0) {
    *(undefined4 *)this = 3;
    *(undefined4 *)(this + 4) = 0;
    *(char **)(this + 8) = "Door is closed";
    return this;
  }
  lVar8 = (longdouble)CountdownTimer::Now();
  if ((float)lVar8 < *(float *)(param_1 + 0x40)) {
    piVar6 = (int *)0x0;
    uVar1 = *(uint *)(param_1 + 0x34);
    if (((uVar1 != 0xffffffff) &&
        (puVar5 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar5 != (undefined *)0xfffffffc)) &&
       (*(uint *)(puVar5 + 8) == uVar1 >> 0xc)) {
      piVar6 = *(int **)(puVar5 + 4);
    }
    pfVar4 = (float *)(**(code **)(*piVar6 + 0x288))(piVar6);
    local_40 = *pfVar4;
    local_3c = pfVar4[1];
    local_38 = pfVar4[2];
    cVar3 = (**(code **)(*(int *)((int)param_2 + 0x4028) + 0x118))
                      ((int)param_2 + 0x4028,&local_40,0x43480000);
    if (cVar3 != '\0') {
      piVar6 = (int *)(**(code **)(*(int *)param_2 + 0x9a4))(param_2);
      (**(code **)(*piVar6 + 0xc0))
                (piVar6,&local_40,1,0x3f800000,0,"Look at door we\'re closing",1,0x3e800000);
      cVar3 = (**(code **)(*(int *)((int)param_2 + 0x4028) + 0x118))
                        ((int)param_2 + 0x4028,&local_40,0x42c80000);
      if (cVar3 != '\0') {
        iVar7 = 0;
        uVar1 = *(uint *)(param_1 + 0x34);
        if (((uVar1 != 0xffffffff) &&
            (puVar5 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar5 != (undefined *)0xfffffffc)) &&
           (*(uint *)(puVar5 + 8) == uVar1 >> 0xc)) {
          iVar7 = *(int *)(puVar5 + 4);
        }
        if (*(int *)(&DAT_000015f4 + iVar7) == 2) {
          (**(code **)(*(int *)param_2 + 0x234))((CAI_Concept *)&local_28,param_2);
          local_34 = local_40 - local_28;
          local_30 = local_3c - local_24;
          local_2c = local_38 - local_20;
          VectorNormalize((Vector *)&local_34);
          piVar6 = (int *)(**(code **)(*(int *)param_2 + 0x9a4))(param_2);
          pfVar4 = (float *)(**(code **)(*piVar6 + 0xbc))(piVar6);
          if (0.7 < pfVar4[1] * local_30 + *pfVar4 * local_34 + pfVar4[2] * local_2c) {
            uVar1 = *(uint *)(param_1 + 0x34);
            if (((uVar1 == 0xffffffff) ||
                (puVar5 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar5 == (undefined *)0xfffffffc)
                ) || (*(uint *)(puVar5 + 8) != uVar1 >> 0xc)) {
              piVar6 = (int *)0x0;
            }
            else {
              piVar6 = *(int **)(puVar5 + 4);
            }
            (**(code **)(*piVar6 + 0x1ac))(piVar6,param_2,param_2,1,0);
            (**(code **)(*(int *)param_2 + 0x6e8))(param_2,piVar6,3);
            pcVar2 = *(code **)(*(int *)param_2 + 0x7b4);
            CAI_Concept::CAI_Concept((CAI_Concept *)&local_28,"SurvivorBotClosingDoorBehindUs");
            (*pcVar2)(param_2,(CAI_Concept *)&local_28,1,0,0,0,0);
            *(undefined4 *)this = 3;
            *(undefined4 *)(this + 4) = 0;
            *(char **)(this + 8) = "Tried to close the door";
            return this;
          }
        }
      }
    }
    *(undefined4 *)this = 0;
    *(undefined4 *)(this + 4) = 0;
    *(undefined4 *)(this + 8) = 0;
    return this;
  }
  *(undefined4 *)this = 3;
  *(undefined4 *)(this + 4) = 0;
  *(char **)(this + 8) = "Taking too much time - giving up";
  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)