L L4D2node

CTerrorPlayer::ModifyOrAppendDerivedCriteria

0x009f4fe0 · 613 bytes · __thiscall

_ZN13CTerrorPlayer29ModifyOrAppendDerivedCriteriaER14AI_CriteriaSet

Decompiled

undefined (2 params)

/* CTerrorPlayer::ModifyOrAppendDerivedCriteria(AI_CriteriaSet&) */

void __thiscall
CTerrorPlayer::ModifyOrAppendDerivedCriteria(CTerrorPlayer *this,AI_CriteriaSet *param_1)

{
  int iVar1;
  char *pcVar2;
  CBaseEntity *this_00;
  int in_GS_OFFSET;
  undefined **local_12c;
  undefined1 local_128;
  undefined1 local_127;
  undefined4 local_24;
  int local_20;
  
  local_20 = *(int *)(in_GS_OFFSET + 0x14);
  if ((ModifyOrAppendDerivedCriteria(AI_CriteriaSet&)::entCache == '\0') &&
     (iVar1 = __cxa_guard_acquire(&ModifyOrAppendDerivedCriteria(AI_CriteriaSet&)::entCache),
     iVar1 != 0)) {
    ModifyOrAppendDerivedCriteria(AI_CriteriaSet&)::entCache._0_4_ = 0xffffffff;
    ModifyOrAppendDerivedCriteria(AI_CriteriaSet&)::entCache._4_4_ = 0xffffffff;
    ModifyOrAppendDerivedCriteria(AI_CriteriaSet&)::entCache._8_4_ = 0xffffffff;
    ModifyOrAppendDerivedCriteria(AI_CriteriaSet&)::entCache._12_4_ = 0xffffffff;
    ModifyOrAppendDerivedCriteria(AI_CriteriaSet&)::entCache._16_4_ = 0xffffffff;
    ModifyOrAppendDerivedCriteria(AI_CriteriaSet&)::entCache._20_4_ = 0xffffffff;
    ModifyOrAppendDerivedCriteria(AI_CriteriaSet&)::entCache._24_4_ = 0xffffffff;
    ModifyOrAppendDerivedCriteria(AI_CriteriaSet&)::entCache._28_4_ = 0xffffffff;
    ModifyOrAppendDerivedCriteria(AI_CriteriaSet&)::entCache._32_4_ = 0;
    ModifyOrAppendDerivedCriteria(AI_CriteriaSet&)::entCache._36_4_ = 0;
    ModifyOrAppendDerivedCriteria(AI_CriteriaSet&)::entCache._40_4_ = 0;
    ModifyOrAppendDerivedCriteria(AI_CriteriaSet&)::entCache._44_4_ = 0;
    __cxa_guard_release(&ModifyOrAppendDerivedCriteria(AI_CriteriaSet&)::entCache);
  }
  local_12c = &PTR_InitQuietTruncation_00c08ee8;
  local_128 = 1;
  local_127 = 0;
  local_24 = 0;
  iVar1 = AI_CriteriaSet::FindCriterionIndex(param_1,"subject");
  if ((((-1 < iVar1) && (iVar1 < *(short *)(param_1 + 0x12))) &&
      (pcVar2 = (char *)AI_CriteriaSet::GetValue(param_1,iVar1), pcVar2 != (char *)0x0)) &&
     (((*pcVar2 != '\0' && (iVar1 = _V_stricmp(pcVar2,"None"), iVar1 != 0)) &&
      ((this_00 = (CBaseEntity *)TerrorGetPlayerPointerFromCharacterName(pcVar2),
       this_00 != (CBaseEntity *)0x0 ||
       (this_00 = (CBaseEntity *)
                  CFindEntityCache::Lookup
                            ((CFindEntityCache *)
                             ModifyOrAppendDerivedCriteria(AI_CriteriaSet&)::entCache,pcVar2),
       this_00 != (CBaseEntity *)0x0)))))) {
    if (((byte)this_00[0x14d] & 8) != 0) {
      CBaseEntity::CalcAbsolutePosition(this_00);
    }
    if (((byte)this[0x14d] & 8) != 0) {
      CBaseEntity::CalcAbsolutePosition((CBaseEntity *)this);
    }
    pcVar2 = (char *)CFmtStrN<256>::sprintf
                               ((CFmtStrN<256> *)&local_12c,"%f",
                                (double)SQRT((*(float *)(this + 0x2e8) - *(float *)(this_00 + 0x2e8)
                                             ) * (*(float *)(this + 0x2e8) -
                                                 *(float *)(this_00 + 0x2e8)) +
                                             (*(float *)(this + 0x2e0) - *(float *)(this_00 + 0x2e0)
                                             ) * (*(float *)(this + 0x2e0) -
                                                 *(float *)(this_00 + 0x2e0)) +
                                             (*(float *)(this + 0x2e4) - *(float *)(this_00 + 0x2e4)
                                             ) * (*(float *)(this + 0x2e4) -
                                                 *(float *)(this_00 + 0x2e4))));
    AI_CriteriaSet::AppendCriteria(param_1,"dist_from_subject",pcVar2,1.0);
  }
  if (local_20 != *(int *)(in_GS_OFFSET + 0x14)) {
                    /* WARNING: Subroutine does not return */
    __stack_chk_fail();
  }
  return;
}

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)