L L4D2node

DispatchResponseToSurvivorsWithVisibility::operator()

0x00970ce0 · 483 bytes · __thiscall

_ZN41DispatchResponseToSurvivorsWithVisibilityclEP11CBasePlayer

Decompiled

undefined (2 params)

/* DispatchResponseToSurvivorsWithVisibility::TEMPNAMEPLACEHOLDERVALUE(CBasePlayer*) */

undefined4 __thiscall
DispatchResponseToSurvivorsWithVisibility::operator()
          (DispatchResponseToSurvivorsWithVisibility *this,CBasePlayer *param_1)

{
  CBaseEntity CVar1;
  CBaseEntity *this_00;
  code *pcVar2;
  char cVar3;
  int iVar4;
  CBaseEntity *pCVar5;
  uint uVar6;
  int in_GS_OFFSET;
  CAI_Concept local_134 [8];
  undefined **local_12c;
  undefined1 local_128;
  undefined1 local_127 [259];
  undefined4 local_24;
  int local_20;
  
  local_20 = *(int *)(in_GS_OFFSET + 0x14);
  if (((param_1 != (CBasePlayer *)0x0) &&
      (cVar3 = (**(code **)(*(int *)param_1 + 0x16c))(param_1), cVar3 != '\0')) &&
     (param_1 != *(CBasePlayer **)this)) {
    iVar4 = CBaseEntity::GetTeamNumber((CBaseEntity *)param_1);
    cVar3 = IsASurvivorTeam(iVar4);
    if (cVar3 != '\0') {
      this_00 = *(CBaseEntity **)this;
      local_128 = 1;
      local_12c = &PTR_InitQuietTruncation_00c08ee8;
      local_127[0] = 0;
      local_24 = 0;
      if (this_00 == (CBaseEntity *)0x0) {
        uVar6 = 0;
        iVar4 = 0;
      }
      else {
        if (((byte)param_1[0x14d] & 8) == 0) {
          CVar1 = this_00[0x14d];
        }
        else {
          CBaseEntity::CalcAbsolutePosition((CBaseEntity *)param_1);
          this_00 = *(CBaseEntity **)this;
          CVar1 = this_00[0x14d];
        }
        pCVar5 = this_00;
        if (((byte)CVar1 & 8) != 0) {
          CBaseEntity::CalcAbsolutePosition(this_00);
          pCVar5 = *(CBaseEntity **)this;
        }
        iVar4 = (int)SQRT((*(float *)(this_00 + 0x2e0) - *(float *)(param_1 + 0x2e0)) *
                          (*(float *)(this_00 + 0x2e0) - *(float *)(param_1 + 0x2e0)) +
                          (*(float *)(this_00 + 0x2e8) - *(float *)(param_1 + 0x2e8)) *
                          (*(float *)(this_00 + 0x2e8) - *(float *)(param_1 + 0x2e8)) +
                          (*(float *)(this_00 + 0x2e4) - *(float *)(param_1 + 0x2e4)) *
                          (*(float *)(this_00 + 0x2e4) - *(float *)(param_1 + 0x2e4)));
        uVar6 = CBaseCombatCharacter::IsAbleToSee((CBaseCombatCharacter *)param_1,pCVar5,0);
        uVar6 = uVar6 & 0xff;
      }
      CFmtStrN<256>::sprintf
                ((CFmtStrN<256> *)&local_12c,"distancetoactor:%d,actorvisible:%d,%s",iVar4,uVar6,
                 *(undefined4 *)(this + 8));
      pcVar2 = *(code **)(*(int *)param_1 + 0x7b4);
      CAI_Concept::CAI_Concept(local_134,*(char **)(this + 4));
      (*pcVar2)(param_1,local_134,1,local_127,0,0,0);
    }
  }
  if (local_20 != *(int *)(in_GS_OFFSET + 0x14)) {
                    /* WARNING: Subroutine does not return */
    __stack_chk_fail();
  }
  return 1;
}

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)