L L4D2node

IIntention::SelectMoreDangerousThreat

0x007533f0 · 431 bytes · __thiscall

_ZNK10IIntention25SelectMoreDangerousThreatEPK8INextBotPK20CBaseCombatCharacterPS3_S6_

Decompiled

undefined (5 params)

/* IIntention::SelectMoreDangerousThreat(INextBot const*, CBaseCombatCharacter const*,
   CBaseCombatCharacter*, CBaseCombatCharacter*) const */

CBaseCombatCharacter * __thiscall
IIntention::SelectMoreDangerousThreat
          (IIntention *this,INextBot *param_1,CBaseCombatCharacter *param_2,
          CBaseCombatCharacter *param_3,CBaseCombatCharacter *param_4)

{
  float fVar1;
  float fVar2;
  float fVar3;
  float fVar4;
  float fVar5;
  float fVar6;
  CBaseCombatCharacter CVar7;
  int iVar8;
  int *piVar9;
  CBaseCombatCharacter *pCVar10;
  
  iVar8 = (**(code **)(*(int *)this + 8))(this);
  while( true ) {
    if (iVar8 == 0) {
      if (((byte)param_3[0x14d] & 8) == 0) {
        CVar7 = param_2[0x14d];
      }
      else {
        CBaseEntity::CalcAbsolutePosition((CBaseEntity *)param_3);
        CVar7 = param_2[0x14d];
      }
      if (((byte)CVar7 & 8) != 0) {
        CBaseEntity::CalcAbsolutePosition((CBaseEntity *)param_2);
      }
      fVar1 = *(float *)(param_2 + 0x2e4);
      fVar2 = *(float *)(param_2 + 0x2e8);
      fVar3 = *(float *)(param_2 + 0x2e0);
      fVar4 = *(float *)(param_3 + 0x2e4);
      fVar5 = *(float *)(param_3 + 0x2e8);
      fVar6 = *(float *)(param_3 + 0x2e0);
      if (((byte)param_4[0x14d] & 8) == 0) {
        CVar7 = param_2[0x14d];
      }
      else {
        CBaseEntity::CalcAbsolutePosition((CBaseEntity *)param_4);
        CVar7 = param_2[0x14d];
      }
      if (((byte)CVar7 & 8) != 0) {
        CBaseEntity::CalcAbsolutePosition((CBaseEntity *)param_2);
      }
      if ((fVar2 - fVar5) * (fVar2 - fVar5) + (fVar1 - fVar4) * (fVar1 - fVar4) +
          (fVar3 - fVar6) * (fVar3 - fVar6) <
          (*(float *)(param_2 + 0x2e0) - *(float *)(param_4 + 0x2e0)) *
          (*(float *)(param_2 + 0x2e0) - *(float *)(param_4 + 0x2e0)) +
          (*(float *)(param_2 + 0x2e8) - *(float *)(param_4 + 0x2e8)) *
          (*(float *)(param_2 + 0x2e8) - *(float *)(param_4 + 0x2e8)) +
          (*(float *)(param_2 + 0x2e4) - *(float *)(param_4 + 0x2e4)) *
          (*(float *)(param_2 + 0x2e4) - *(float *)(param_4 + 0x2e4))) {
        param_4 = param_3;
      }
      return param_4;
    }
    piVar9 = (int *)__dynamic_cast(iVar8,&INextBotEventResponder::typeinfo,
                                   &IContextualQuery::typeinfo,0xfffffffe);
    if ((piVar9 != (int *)0x0) &&
       (pCVar10 = (CBaseCombatCharacter *)
                  (**(code **)(*piVar9 + 0x20))(piVar9,param_1,param_2,param_3,param_4),
       pCVar10 != (CBaseCombatCharacter *)0x0)) break;
    iVar8 = (**(code **)(*(int *)this + 0xc))(this,iVar8);
  }
  return pCVar10;
}

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)