L L4D2node

SurvivorTeamSituation::MarkFriendAsVisible

0x00965440 · 614 bytes · __thiscall

_ZN21SurvivorTeamSituation19MarkFriendAsVisibleEP13CTerrorPlayer

Decompiled

undefined (2 params)

/* SurvivorTeamSituation::MarkFriendAsVisible(CTerrorPlayer*) */

void __thiscall
SurvivorTeamSituation::MarkFriendAsVisible(SurvivorTeamSituation *this,CTerrorPlayer *param_1)

{
  uint uVar1;
  int iVar2;
  int *piVar3;
  int iVar4;
  undefined4 *puVar5;
  SurvivorTeamSituation *pSVar6;
  int iVar7;
  undefined *puVar8;
  int iVar9;
  longdouble lVar10;
  int local_28;
  
  if (param_1 == (CTerrorPlayer *)0x0) {
    return;
  }
  iVar4 = *(int *)(this + 0xd6f8);
  if (0 < iVar4) {
    iVar7 = 0;
    pSVar6 = this;
    do {
      uVar1 = *(uint *)(pSVar6 + 0xd6d4);
      if ((((uVar1 != 0xffffffff) &&
           (puVar8 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar8 != (undefined *)0xfffffffc)) &&
          (*(uint *)(puVar8 + 8) == uVar1 >> 0xc)) && (*(int *)(puVar8 + 4) != 0)) {
        iVar9 = *(int *)(*(int *)(puVar8 + 4) + 0x30);
        if (iVar9 == 0) {
          iVar9 = 0;
        }
        else {
          iVar9 = iVar9 - *(int *)(gpGlobals + 0x58) >> 4;
        }
        if (*(int *)(param_1 + 0x30) == 0) {
          iVar2 = 0;
        }
        else {
          iVar2 = *(int *)(param_1 + 0x30) - *(int *)(gpGlobals + 0x58) >> 4;
        }
        if (iVar9 == iVar2) {
          iVar7 = iVar7 * 0xc;
          lVar10 = (longdouble)IntervalTimer::Now();
          if ((float)lVar10 == *(float *)(this + iVar7 + 0xd6dc)) {
            return;
          }
          (**(code **)(*(int *)(this + iVar7 + 55000) + 4))
                    (this + iVar7 + 55000,this + iVar7 + 0xd6dc);
          *(float *)(this + iVar7 + 0xd6dc) = (float)lVar10;
          return;
        }
      }
      iVar7 = iVar7 + 1;
      pSVar6 = pSVar6 + 0xc;
    } while (iVar7 != iVar4);
    if (2 < iVar7) {
      local_28 = 0;
      pSVar6 = this + 55000;
      do {
        uVar1 = *(uint *)(pSVar6 + -4);
        if (((uVar1 == 0xffffffff) ||
            (puVar8 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar8 == (undefined *)0xfffffffc)) ||
           ((*(uint *)(puVar8 + 8) != uVar1 >> 0xc ||
            (*(CBaseEntity **)(puVar8 + 4) == (CBaseEntity *)0x0)))) {
LAB_0096558f:
          piVar3 = (int *)(**(code **)(*(int *)param_1 + 0xc))(param_1);
          *(int *)(pSVar6 + -4) = *piVar3;
          lVar10 = (longdouble)IntervalTimer::Now();
          if ((float)lVar10 != *(float *)(this + (int)(pSVar6 + (4 - (int)this)))) {
            (**(code **)(*(int *)pSVar6 + 4))(pSVar6,pSVar6 + 4);
            *(float *)(this + (int)(pSVar6 + (4 - (int)this))) = (float)lVar10;
          }
        }
        else {
          iVar4 = CBaseEntity::GetTeamNumber(*(CBaseEntity **)(puVar8 + 4));
          iVar7 = CBaseEntity::GetTeamNumber(*(CBaseEntity **)(this + 4));
          if (iVar4 != iVar7) goto LAB_0096558f;
        }
        local_28 = local_28 + 1;
        pSVar6 = pSVar6 + 0xc;
        if (*(int *)(this + 0xd6f8) <= local_28) {
          return;
        }
      } while( true );
    }
  }
  puVar5 = (undefined4 *)(**(code **)(*(int *)param_1 + 0xc))(param_1);
  *(undefined4 *)(this + iVar4 * 0xc + 0xd6d4) = *puVar5;
  iVar4 = *(int *)(this + 0xd6f8) * 0xc;
  lVar10 = (longdouble)IntervalTimer::Now();
  if ((float)lVar10 != *(float *)(this + iVar4 + 0xd6dc)) {
    (**(code **)(*(int *)(this + iVar4 + 55000) + 4))(this + iVar4 + 55000,this + iVar4 + 0xd6dc);
    *(float *)(this + iVar4 + 0xd6dc) = (float)lVar10;
  }
  *(int *)(this + 0xd6f8) = *(int *)(this + 0xd6f8) + 1;
  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)