L L4D2node

CCSPlayer::MoveToNextIntroCamera

0x006574a0 · 1248 bytes · __thiscall

_ZN9CCSPlayer21MoveToNextIntroCameraEv

Decompiled

undefined (1 param)

/* CCSPlayer::MoveToNextIntroCamera() */

void __thiscall CCSPlayer::MoveToNextIntroCamera(CCSPlayer *this)

{
  char *pcVar1;
  int *piVar2;
  uint *puVar3;
  uint uVar4;
  undefined4 *puVar5;
  char *pcVar6;
  float *pfVar7;
  CBaseEntity *pCVar8;
  uint uVar9;
  undefined *puVar10;
  CBaseEntity *this_00;
  CBaseEntity *this_01;
  float local_40;
  float local_3c;
  float local_38;
  undefined4 local_34;
  undefined4 local_30;
  undefined4 local_2c;
  float local_28;
  float local_24;
  float local_20;
  
  pCVar8 = (CBaseEntity *)0x0;
  uVar4 = *(uint *)(this + 0x2834);
  if (((uVar4 != 0xffffffff) &&
      (puVar10 = g_pEntityList + (uVar4 & 0xfff) * 0x10, puVar10 != (undefined *)0xfffffffc)) &&
     (*(uint *)(puVar10 + 8) == uVar4 >> 0xc)) {
    pCVar8 = *(CBaseEntity **)(puVar10 + 4);
  }
  piVar2 = (int *)CGlobalEntityList::FindEntityByClassname
                            ((CGlobalEntityList *)gEntList,pCVar8,"point_viewcontrol");
  if (piVar2 != (int *)0x0) {
    puVar3 = (uint *)(**(code **)(*piVar2 + 0xc))(piVar2);
    puVar10 = g_pEntityList;
    uVar4 = *puVar3;
    *(uint *)(this + 0x2834) = uVar4;
    if (uVar4 == 0xffffffff) goto LAB_0065753c;
    uVar9 = uVar4 & 0xfff;
    piVar2 = (int *)(puVar10 + uVar9 * 0x10 + 4);
    if (((piVar2 == (int *)0x0) || (*(uint *)(puVar10 + uVar9 * 0x10 + 8) != uVar4 >> 0xc)) ||
       (*(int *)(puVar10 + uVar9 * 0x10 + 4) == 0)) goto LAB_0065753c;
    if (*(uint *)(puVar10 + uVar9 * 0x10 + 8) == uVar4 >> 0xc) goto LAB_006577d9;
    goto LAB_0065759e;
  }
  *(undefined4 *)(this + 0x2834) = 0xffffffff;
LAB_0065753c:
  piVar2 = (int *)CGlobalEntityList::FindEntityByClassname
                            ((CGlobalEntityList *)gEntList,(CBaseEntity *)0x0,"point_viewcontrol");
  if (piVar2 == (int *)0x0) {
    *(undefined4 *)(this + 0x2834) = 0xffffffff;
    pCVar8 = (CBaseEntity *)0x0;
  }
  else {
    puVar3 = (uint *)(**(code **)(*piVar2 + 0xc))(piVar2);
    puVar10 = g_pEntityList;
    uVar4 = *puVar3;
    *(uint *)(this + 0x2834) = uVar4;
    if (uVar4 == 0xffffffff) {
      pCVar8 = (CBaseEntity *)0x0;
    }
    else {
      piVar2 = (int *)(puVar10 + (uVar4 & 0xfff) * 0x10 + 4);
      if ((piVar2 == (int *)0x0) || (piVar2[1] != uVar4 >> 0xc)) {
LAB_0065759e:
        uVar4 = *(uint *)(this + 0x2834);
        pCVar8 = (CBaseEntity *)0x0;
      }
      else {
LAB_006577d9:
        if (*piVar2 == 0) goto LAB_0065759e;
        pcVar1 = *(char **)(*piVar2 + 0xf8);
        pcVar6 = "";
        if (pcVar1 != (char *)0x0) {
          pcVar6 = pcVar1;
        }
        pCVar8 = (CBaseEntity *)
                 CGlobalEntityList::FindEntityByName
                           ((CGlobalEntityList *)gEntList,(CBaseEntity *)0x0,pcVar6,
                            (CBaseEntity *)0x0,(CBaseEntity *)0x0,(CBaseEntity *)0x0,
                            (IEntityFindFilter *)0x0);
        uVar4 = *(uint *)(this + 0x2834);
        puVar10 = g_pEntityList;
        if (uVar4 == 0xffffffff) goto LAB_006575c8;
      }
      puVar10 = puVar10 + (uVar4 & 0xfff) * 0x10;
      if (((puVar10 != (undefined *)0xfffffffc) && (*(uint *)(puVar10 + 8) == uVar4 >> 0xc)) &&
         (*(int *)(puVar10 + 4) != 0)) goto LAB_006575fc;
    }
  }
LAB_006575c8:
  piVar2 = (int *)CGlobalEntityList::FindEntityByClassname
                            ((CGlobalEntityList *)gEntList,(CBaseEntity *)0x0,
                             "info_player_terrorist");
  if (piVar2 == (int *)0x0) {
    *(undefined4 *)(this + 0x2834) = 0xffffffff;
  }
  else {
    puVar5 = (undefined4 *)(**(code **)(*piVar2 + 0xc))(piVar2);
    *(undefined4 *)(this + 0x2834) = *puVar5;
  }
LAB_006575fc:
  (**(code **)(*(int *)this + 0x254))(this,&vec3_origin);
  UTIL_SetSize((CBaseEntity *)this,(Vector *)&vec3_origin,(Vector *)&vec3_origin);
  if (pCVar8 == (CBaseEntity *)0x0) {
    if (*(int *)(this + 0x2834) != -1) {
      pCVar8 = (CBaseEntity *)0x0;
      pfVar7 = (float *)(**(code **)(*g_pGameRules + 0x7c))(g_pGameRules);
      uVar4 = *(uint *)(this + 0x2834);
      if (uVar4 != 0xffffffff) {
        puVar10 = g_pEntityList + (uVar4 & 0xfff) * 0x10;
        if (puVar10 == (undefined *)0xfffffffc) {
          pCVar8 = (CBaseEntity *)0x0;
        }
        else if (*(uint *)(puVar10 + 8) == uVar4 >> 0xc) {
          pCVar8 = *(CBaseEntity **)(puVar10 + 4);
        }
      }
      if (((byte)pCVar8[0x14d] & 8) != 0) {
        CBaseEntity::CalcAbsolutePosition(pCVar8);
      }
      local_28 = *pfVar7 + *(float *)(pCVar8 + 0x2e0);
      local_24 = pfVar7[1] + *(float *)(pCVar8 + 0x2e4);
      local_20 = pfVar7[2] + *(float *)(pCVar8 + 0x2e8);
      CBaseEntity::SetAbsOrigin((CBaseEntity *)this,(Vector *)&local_28);
    }
    local_28 = 0.0;
    local_24 = 0.0;
    local_20 = 0.0;
    CBaseEntity::SetAbsAngles((CBaseEntity *)this,(QAngle *)&local_28);
    *(undefined4 *)(this + 0x2834) = 0xffffffff;
    return;
  }
  uVar4 = *(uint *)(this + 0x2834);
  this_01 = (CBaseEntity *)0x0;
  if (((uVar4 != 0xffffffff) &&
      (puVar10 = g_pEntityList + (uVar4 & 0xfff) * 0x10, puVar10 != (undefined *)0xfffffffc)) &&
     (*(uint *)(puVar10 + 8) == uVar4 >> 0xc)) {
    this_01 = *(CBaseEntity **)(puVar10 + 4);
  }
  if (((byte)this_01[0x14d] & 8) != 0) {
    CBaseEntity::CalcAbsolutePosition(this_01);
  }
  if (((byte)pCVar8[0x14d] & 8) != 0) {
    CBaseEntity::CalcAbsolutePosition(pCVar8);
  }
  uVar4 = *(uint *)(this + 0x2834);
  local_40 = *(float *)(pCVar8 + 0x2e0) - *(float *)(this_01 + 0x2e0);
  local_3c = *(float *)(pCVar8 + 0x2e4) - *(float *)(this_01 + 0x2e4);
  this_00 = (CBaseEntity *)0x0;
  local_38 = *(float *)(pCVar8 + 0x2e8) - *(float *)(this_01 + 0x2e8);
  if (((uVar4 != 0xffffffff) &&
      (puVar10 = g_pEntityList + (uVar4 & 0xfff) * 0x10, puVar10 != (undefined *)0xfffffffc)) &&
     (*(uint *)(puVar10 + 8) == uVar4 >> 0xc)) {
    this_00 = *(CBaseEntity **)(puVar10 + 4);
  }
  if (((byte)this_00[0x14d] & 8) != 0) {
    CBaseEntity::CalcAbsolutePosition(this_00);
  }
  local_34 = *(undefined4 *)(this_00 + 0x2e0);
  local_30 = *(undefined4 *)(this_00 + 0x2e4);
  local_2c = *(undefined4 *)(this_00 + 0x2e8);
  VectorNormalize((Vector *)&local_40);
  VectorAngles((Vector *)&local_40,(QAngle *)&local_28);
  CBaseEntity::SetAbsOrigin((CBaseEntity *)this,(Vector *)&local_34);
  CBaseEntity::SetAbsAngles((CBaseEntity *)this,(QAngle *)&local_28);
  CBasePlayer::SnapEyeAngles((CBasePlayer *)this,(QAngle *)&local_28);
  *(float *)(this + 0x2838) = *(float *)(gpGlobals + 0xc) + 6.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)