L L4D2node

CAI_RR_Lifeboat::LoadFromEntity

0x005d0770 · 211 bytes · __thiscall

_ZN15CAI_RR_Lifeboat14LoadFromEntityEP11CBaseEntity

Decompiled

undefined (2 params)

/* CAI_RR_Lifeboat::LoadFromEntity(CBaseEntity*) */

void __thiscall CAI_RR_Lifeboat::LoadFromEntity(CAI_RR_Lifeboat *this,CBaseEntity *param_1)

{
  int *piVar1;
  int iVar2;
  int iVar3;
  void *pvVar4;
  char *pcVar5;
  char *pcVar6;
  
  if (param_1 != (CBaseEntity *)0x0) {
    iVar2 = CBaseEntity::GetContextCount(param_1);
    if (0 < iVar2) {
      iVar3 = AI_CriteriaSet::GetCount((AI_CriteriaSet *)this);
      iVar3 = iVar2 + 1 + iVar3;
      if ((*(int *)(this + 8) < iVar3) && (-1 < *(int *)(this + 0xc))) {
        *(int *)(this + 8) = iVar3;
        if (*(void **)(this + 4) == (void *)0x0) {
          pvVar4 = malloc(iVar3 * 0x50);
          *(void **)(this + 4) = pvVar4;
        }
        else {
          pvVar4 = realloc(*(void **)(this + 4),iVar3 * 0x50);
          *(void **)(this + 4) = pvVar4;
        }
      }
      iVar3 = 0;
      do {
        piVar1 = (int *)(*(int *)(param_1 + 0xb8) + iVar3 * 0xc);
        if ((float)piVar1[2] == 0.0) {
          pcVar6 = (char *)piVar1[1];
          pcVar5 = (char *)*piVar1;
          if (pcVar6 == (char *)0x0) {
            pcVar6 = "";
          }
          if (pcVar5 == (char *)0x0) {
            pcVar5 = "";
          }
          AI_CriteriaSet::AppendCriteria((AI_CriteriaSet *)this,pcVar5,pcVar6,1.0);
        }
        iVar3 = iVar3 + 1;
      } while (iVar3 != iVar2);
    }
  }
  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)