L L4D2node

SurvivorUseObject::ShouldGiveUp

0x00936410 · 512 bytes · __thiscall

_ZNK17SurvivorUseObject12ShouldGiveUpEP11SurvivorBot

Decompiled

undefined (2 params)

/* SurvivorUseObject::ShouldGiveUp(SurvivorBot*) const */

undefined4 __thiscall SurvivorUseObject::ShouldGiveUp(SurvivorUseObject *this,SurvivorBot *param_1)

{
  INextBot *pIVar1;
  float fVar2;
  uint uVar3;
  CBaseCombatCharacter *pCVar4;
  char cVar5;
  int iVar6;
  undefined4 uVar7;
  INextBot *this_00;
  CBaseEntity *pCVar8;
  undefined *puVar9;
  undefined4 uVar10;
  int in_GS_OFFSET;
  longdouble lVar11;
  INextBot local_24;
  undefined1 local_23;
  undefined1 local_22;
  undefined1 local_21;
  int local_20;
  
  local_20 = *(int *)(in_GS_OFFSET + 0x14);
  iVar6 = (**(code **)(*(int *)param_1 + 0x9a8))(param_1);
  if (*(int *)(iVar6 + 0x70) < 1) {
LAB_0093646c:
    pIVar1 = (INextBot *)(this + 0x50);
    this_00 = pIVar1;
    lVar11 = (longdouble)CountdownTimer::Now();
    if (*(float *)(this + 0x58) <= (float)lVar11) {
      lVar11 = (longdouble)RandomFloat(0x3f800000,0x40000000);
      fVar2 = (float)lVar11;
      lVar11 = (longdouble)CountdownTimer::Now();
      if ((float)lVar11 + fVar2 != *(float *)(this + 0x58)) {
        (**(code **)(*(int *)(this + 0x50) + 4))(pIVar1,this + 0x58);
        *(float *)(this + 0x58) = (float)lVar11 + fVar2;
      }
      if (fVar2 != *(float *)(this + 0x54)) {
        (**(code **)(*(int *)(this + 0x50) + 4))(pIVar1,this + 0x54);
        *(float *)(this + 0x54) = fVar2;
      }
      uVar3 = *(uint *)(this + 0x34);
      pCVar8 = (CBaseEntity *)0x0;
      if (((uVar3 != 0xffffffff) &&
          (puVar9 = g_pEntityList + (uVar3 & 0xfff) * 0x10, puVar9 != (undefined *)0xfffffffc)) &&
         (*(uint *)(puVar9 + 8) == uVar3 >> 0xc)) {
        pCVar8 = *(CBaseEntity **)(puVar9 + 4);
      }
      this_00 = (INextBot *)param_1;
      cVar5 = SurvivorBot::IsReachable(param_1,pCVar8);
      if (cVar5 == '\0') {
        this_00 = (INextBot *)(param_1 + 0x4028);
        uVar10 = INextBot::IsDebugging(this_00,0x101);
        if ((char)uVar10 != '\0') {
          uVar7 = (**(code **)(*(int *)param_1 + 0xb8))(param_1);
          local_24 = (INextBot)0xff;
          local_23 = 0xff;
          local_22 = 0;
          local_21 = 0xff;
          this_00 = &local_24;
          ConColorMsg(this_00,"%3.2f: %s giving up, object is UNREACHABLE\n",
                      (double)*(float *)(gpGlobals + 0xc),uVar7);
          goto LAB_00936487;
        }
        goto LAB_009365de;
      }
    }
    uVar10 = 0;
  }
  else {
    uVar3 = **(uint **)(iVar6 + 100);
    if ((((uVar3 == 0xffffffff) ||
         (puVar9 = g_pEntityList + (uVar3 & 0xfff) * 0x10, puVar9 == (undefined *)0xfffffffc)) ||
        (*(uint *)(puVar9 + 8) != uVar3 >> 0xc)) ||
       (pCVar4 = *(CBaseCombatCharacter **)(puVar9 + 4), pCVar4 == (CBaseCombatCharacter *)0x0))
    goto LAB_0093646c;
    this_00 = (INextBot *)(**(code **)(*(int *)param_1 + 0x9a8))(param_1);
    cVar5 = SurvivorIntention::IsImmediatelyDangerousTo
                      ((SurvivorIntention *)this_00,(CTerrorPlayer *)param_1,pCVar4);
    if (cVar5 == '\0') goto LAB_0093646c;
LAB_009365de:
    uVar10 = 1;
  }
LAB_00936487:
  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {
    return uVar10;
  }
                    /* WARNING: Subroutine does not return */
  __stack_chk_fail(this_00);
}

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)