L L4D2node

SurvivorCollectObject::ShouldGiveUp

0x0092a850 · 576 bytes · __thiscall

_ZNK21SurvivorCollectObject12ShouldGiveUpEP11SurvivorBot

Decompiled

undefined (2 params)

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

bool __thiscall
SurvivorCollectObject::ShouldGiveUp(SurvivorCollectObject *this,SurvivorBot *param_1)

{
  uint uVar1;
  code *pcVar2;
  undefined1 uVar3;
  int iVar4;
  int *piVar5;
  undefined4 *puVar6;
  undefined4 uVar7;
  int iVar8;
  undefined *puVar9;
  longdouble lVar10;
  
  iVar4 = SurvivorBot::GetTeamSituation(param_1);
  uVar1 = *(uint *)(iVar4 + 0xd700);
  if (((((uVar1 == 0xffffffff) ||
        (puVar9 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar9 == (undefined *)0xfffffffc)) ||
       (*(uint *)(puVar9 + 8) != uVar1 >> 0xc)) || (*(int *)(puVar9 + 4) == 0)) &&
     ((((uVar1 = *(uint *)(iVar4 + 0xd704), uVar1 == 0xffffffff ||
        (puVar9 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar9 == (undefined *)0xfffffffc)) ||
       ((*(uint *)(puVar9 + 8) != uVar1 >> 0xc || (*(int *)(puVar9 + 4) == 0)))) &&
      ((((uVar1 = *(uint *)(iVar4 + 0xd708), uVar1 == 0xffffffff ||
         (puVar9 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar9 == (undefined *)0xfffffffc)) ||
        ((*(uint *)(puVar9 + 8) != uVar1 >> 0xc || (*(int *)(puVar9 + 4) == 0)))) &&
       ((((uVar1 = *(uint *)(iVar4 + 8), uVar1 == 0xffffffff ||
          (puVar9 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar9 == (undefined *)0xfffffffc)) ||
         (*(uint *)(puVar9 + 8) != uVar1 >> 0xc)) || (*(int *)(puVar9 + 4) == 0)))))))) {
    if ((*(int *)(TheDirector + 0x1c0) < 1) &&
       (lVar10 = (longdouble)CTerrorPlayer::GetTimeSinceAttackedByEnemy((CTerrorPlayer *)param_1),
       2.0 <= (float)lVar10)) {
      uVar3 = SurvivorUseObject::ShouldGiveUp((SurvivorUseObject *)this,param_1);
      return (bool)uVar3;
    }
    uVar1 = *(uint *)(this + 0x34);
    if (((uVar1 != 0xffffffff) &&
        (puVar9 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar9 != (undefined *)0xfffffffc)) &&
       ((*(uint *)(puVar9 + 8) == uVar1 >> 0xc &&
        ((((*(int *)(puVar9 + 4) != 0 &&
           (piVar5 = (int *)__dynamic_cast(*(int *)(puVar9 + 4),&CBaseEntity::typeinfo,
                                           &CWeaponSpawn::typeinfo,0), piVar5 != (int *)0x0)) &&
          (iVar4 = (**(code **)(*piVar5 + 0x3cc))(piVar5), iVar4 == 0x36)) &&
         (piVar5 = (int *)CBaseCombatCharacter::GetActiveWeapon((CBaseCombatCharacter *)param_1),
         piVar5 != (int *)0x0)))))) {
      puVar6 = (undefined4 *)GetAmmoDef();
      pcVar2 = *(code **)*puVar6;
      uVar7 = (**(code **)(*piVar5 + 0x55c))(piVar5);
      iVar4 = (*pcVar2)(puVar6,uVar7,param_1);
      iVar8 = (**(code **)(*piVar5 + 0x55c))(piVar5);
      iVar8 = CBaseCombatCharacter::GetAmmoCount((CBaseCombatCharacter *)param_1,iVar8);
      return (float)iVar4 * 0.4 <= (float)iVar8;
    }
  }
  return true;
}

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)