L L4D2node

CTriggerCameraMultiplayer::AddPlayer

0x00a072b0 · 730 bytes · __thiscall

_ZN25CTriggerCameraMultiplayer9AddPlayerEP11CBasePlayer

Decompiled

undefined (2 params)

/* CTriggerCameraMultiplayer::AddPlayer(CBasePlayer*) */

void __thiscall
CTriggerCameraMultiplayer::AddPlayer(CTriggerCameraMultiplayer *this,CBasePlayer *param_1)

{
  int iVar1;
  CBaseEntity *this_00;
  int iVar2;
  char cVar3;
  undefined4 *puVar4;
  int iVar5;
  void *pvVar6;
  int iVar7;
  undefined *puVar8;
  uint uVar9;
  undefined4 local_30;
  undefined4 local_20 [4];
  
  local_20[0] = 0xffffffff;
  if (param_1 == (CBasePlayer *)0x0) {
    iVar5 = CUtlVector<CHandle<CBaseEntity>,CUtlMemory<CHandle<CBaseEntity>,int>>::Find
                      ((CUtlVector<CHandle<CBaseEntity>,CUtlMemory<CHandle<CBaseEntity>,int>> *)
                       (this + 0x468),(CHandle *)local_20);
    if (-1 < iVar5) {
      return;
    }
    local_30 = 0xffffffff;
  }
  else {
    puVar4 = (undefined4 *)(**(code **)(*(int *)param_1 + 0xc))(param_1);
    local_20[0] = *puVar4;
    iVar5 = CUtlVector<CHandle<CBaseEntity>,CUtlMemory<CHandle<CBaseEntity>,int>>::Find
                      ((CUtlVector<CHandle<CBaseEntity>,CUtlMemory<CHandle<CBaseEntity>,int>> *)
                       (this + 0x468),(CHandle *)local_20);
    if (-1 < iVar5) {
      return;
    }
    puVar4 = (undefined4 *)(**(code **)(*(int *)param_1 + 0xc))(param_1);
    local_30 = *puVar4;
  }
  iVar1 = *(int *)(this + 0x474);
  iVar7 = *(int *)(this + 0x46c);
  iVar5 = iVar1 + 1;
  if (iVar7 < iVar5) {
    iVar2 = *(int *)(this + 0x470);
    if (-1 < iVar2) {
      if (iVar2 == 0) {
        if (iVar7 == 0) {
          if (iVar5 < 9) {
            iVar7 = 8;
            goto LAB_00a074cf;
          }
          iVar7 = 8;
        }
        do {
          iVar7 = iVar7 * 2;
        } while (iVar7 < iVar5);
      }
      else {
        for (iVar7 = (iVar1 / iVar2 + 1) * iVar2; iVar7 < iVar5; iVar7 = (iVar7 + iVar5) / 2) {
        }
      }
LAB_00a074cf:
      *(int *)(this + 0x46c) = iVar7;
      if (*(void **)(this + 0x468) == (void *)0x0) {
        pvVar6 = malloc(iVar7 << 2);
        *(void **)(this + 0x468) = pvVar6;
      }
      else {
        pvVar6 = realloc(*(void **)(this + 0x468),iVar7 << 2);
        *(void **)(this + 0x468) = pvVar6;
        iVar5 = *(int *)(this + 0x474) + 1;
      }
      goto LAB_00a0732a;
    }
  }
  pvVar6 = *(void **)(this + 0x468);
LAB_00a0732a:
  *(int *)(this + 0x474) = iVar5;
  iVar7 = iVar1 * 4;
  iVar5 = (iVar5 - iVar1) + -1;
  *(void **)(this + 0x478) = pvVar6;
  if (0 < iVar5) {
    _V_memmove((void *)((int)pvVar6 + iVar7 + 4),(void *)((int)pvVar6 + iVar7),iVar5 * 4);
    pvVar6 = *(void **)(this + 0x468);
  }
  if ((undefined4 *)(iVar7 + (int)pvVar6) != (undefined4 *)0x0) {
    *(undefined4 *)(iVar7 + (int)pvVar6) = local_30;
  }
  CBasePlayer::EnableControl(param_1,false);
  if (param_1[0x1ac8] != (CBasePlayer)0x0) {
    (**(code **)(*(int *)(param_1 + 0x1a40) + 4))(param_1 + 0x1a40,param_1 + 0x1ac8);
    param_1[0x1ac8] = (CBasePlayer)0x0;
  }
  CBasePlayer::SetViewEntity(param_1,(CBaseEntity *)this);
  uVar9 = *(uint *)(param_1 + 0x1a7c) | 0x77b;
  if (*(uint *)(param_1 + 0x1a7c) != uVar9) {
    (**(code **)(*(int *)(param_1 + 0x1a40) + 4))(param_1 + 0x1a40,param_1 + 0x1a7c);
    *(uint *)(param_1 + 0x1a7c) = uVar9;
  }
  uVar9 = *(uint *)(param_1 + 0x1d84);
  if (((((uVar9 != 0xffffffff) &&
        (puVar8 = g_pEntityList + (uVar9 & 0xfff) * 0x10, puVar8 != (undefined *)0xfffffffc)) &&
       (*(uint *)(puVar8 + 8) == uVar9 >> 0xc)) &&
      (this_00 = *(CBaseEntity **)(puVar8 + 4), this_00 != (CBaseEntity *)0x0)) &&
     (((param_1 == (CBasePlayer *)this_00 ||
       (*(char **)(this_00 + 0x7c) == "point_viewcontrol_multiplayer")) ||
      ((cVar3 = CBaseEntity::ClassMatchesComplex(this_00,"point_viewcontrol_multiplayer"),
       cVar3 != '\0' ||
       ((*(char **)(this_00 + 0x7c) == "point_viewcontrol_survivor" ||
        (cVar3 = CBaseEntity::ClassMatchesComplex(this_00,"point_viewcontrol_survivor"),
        cVar3 != '\0')))))))) {
    CBasePlayer::ClearZoomOwner(param_1);
  }
  CBasePlayer::SetFOV(param_1,(CBaseEntity *)this,(int)*(float *)(this + 0x47c),
                      *(float *)(this + 0x480),0);
  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)