L L4D2node

CAI_ChangeHintGroup::FindQualifiedNPC

0x00b1a020 · 359 bytes · __thiscall

_ZN19CAI_ChangeHintGroup16FindQualifiedNPCEP11CAI_BaseNPCP11CBaseEntityS3_

Decompiled

undefined (4 params)

/* CAI_ChangeHintGroup::FindQualifiedNPC(CAI_BaseNPC*, CBaseEntity*, CBaseEntity*) */

int __thiscall
CAI_ChangeHintGroup::FindQualifiedNPC
          (CAI_ChangeHintGroup *this,CAI_BaseNPC *param_1,CBaseEntity *param_2,CBaseEntity *param_3)

{
  Vector *pVVar1;
  int iVar2;
  char *pcVar3;
  int iVar4;
  char *pcVar5;
  float fVar6;
  
  pcVar5 = "";
  if (*(char **)(this + 0x444) != (char *)0x0) {
    pcVar5 = *(char **)(this + 0x444);
  }
  pVVar1 = (Vector *)(this + 0x39c);
LAB_00b1a048:
  iVar2 = *(int *)(this + 0x440);
  if (iVar2 == 1) goto LAB_00b1a110;
  do {
    if (iVar2 == 2) {
      fVar6 = *(float *)(this + 0x44c);
      if (fVar6 == 0.0) {
        fVar6 = 3.4028235e+38;
      }
      param_1 = (CAI_BaseNPC *)
                CGlobalEntityList::FindEntityInSphere
                          ((CGlobalEntityList *)gEntList,(CBaseEntity *)param_1,pVVar1,fVar6);
    }
    else if (iVar2 == 0) {
      param_1 = (CAI_BaseNPC *)
                CGlobalEntityList::FindEntityByNameWithin
                          ((CGlobalEntityList *)gEntList,(CBaseEntity *)param_1,pcVar5,pVVar1,
                           *(float *)(this + 0x44c),(CBaseEntity *)0x0,param_2,param_3);
    }
    while( true ) {
      if (param_1 == (CAI_BaseNPC *)0x0) {
        return 0;
      }
      iVar2 = CBaseEntity::MyNPCPointer();
      if (iVar2 == 0) goto LAB_00b1a048;
      if (*(int *)(this + 0x440) != 2) {
        return iVar2;
      }
      pcVar3 = "";
      if (*(char **)(iVar2 + 0x1cf8) != (char *)0x0) {
        pcVar3 = *(char **)(iVar2 + 0x1cf8);
      }
      if (pcVar5 == pcVar3) {
        return iVar2;
      }
      iVar4 = _V_stricmp(pcVar3,pcVar5);
      if (iVar4 == 0) {
        return iVar2;
      }
      iVar2 = *(int *)(this + 0x440);
      if (iVar2 != 1) break;
LAB_00b1a110:
      param_1 = (CAI_BaseNPC *)
                CGlobalEntityList::FindEntityByClassnameWithin
                          ((CGlobalEntityList *)gEntList,(CBaseEntity *)param_1,pcVar5,pVVar1,
                           *(float *)(this + 0x44c));
    }
  } while( 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)