L L4D2node

CTerrorPlayer::SetPlayerPositionEntity

0x009af7b0 · 850 bytes · __thiscall

_ZN13CTerrorPlayer23SetPlayerPositionEntityEP17CSurvivorPosition

Decompiled

undefined (2 params)

/* CTerrorPlayer::SetPlayerPositionEntity(CSurvivorPosition*) */

void __thiscall
CTerrorPlayer::SetPlayerPositionEntity(CTerrorPlayer *this,CSurvivorPosition *param_1)

{
  code *pcVar1;
  CBaseEdict *pCVar2;
  CTerrorPlayer CVar3;
  undefined4 *puVar4;
  int iVar5;
  int iVar6;
  undefined *puVar7;
  CBaseEntity *this_00;
  uint uVar8;
  uint local_20 [4];
  
  this_00 = (CBaseEntity *)0x0;
  uVar8 = *(uint *)(this + 0x33a4);
  if ((((uVar8 != 0xffffffff) &&
       (puVar7 = g_pEntityList + (uVar8 & 0xfff) * 0x10, puVar7 != (undefined *)0xfffffffc)) &&
      (*(uint *)(puVar7 + 8) == uVar8 >> 0xc)) &&
     (this_00 = *(CBaseEntity **)(puVar7 + 4), this_00 != (CBaseEntity *)0x0)) {
    iVar5 = __dynamic_cast(this_00,&CBaseEntity::typeinfo,&CSurvivorPosition::typeinfo,0);
    if (iVar5 != 0) {
      *(undefined4 *)(iVar5 + 0x444) = 0xffffffff;
    }
  }
  (**(code **)(*(int *)this + 0x98))(this,0,0xffffffff);
  if (param_1 == (CSurvivorPosition *)0x0) {
    CBasePlayer::EnableControl((CBasePlayer *)this,true);
    if (this_00 != (CBaseEntity *)0x0) {
      pcVar1 = *(code **)(*(int *)this + 0x1dc);
      if (((byte)this_00[0x14d] & 8) != 0) {
        CBaseEntity::CalcAbsolutePosition(this_00);
        if (((byte)this_00[0x14d] & 8) != 0) {
          CBaseEntity::CalcAbsolutePosition(this_00);
        }
      }
      (*pcVar1)(this,this_00 + 0x2e0,this_00 + 0x37c,&vec3_origin);
    }
    uVar8 = *(uint *)(this + 0x1a7c) & 0xfffff884;
    if (*(uint *)(this + 0x1a7c) != uVar8) {
      (**(code **)(*(int *)(this + 0x1a40) + 4))(this + 0x1a40,this + 0x1a7c);
      *(uint *)(this + 0x1a7c) = uVar8;
    }
    if (this[0x33a8] != (CTerrorPlayer)0x0) {
      if (this[0x6c] == (CTerrorPlayer)0x0) {
        pCVar2 = *(CBaseEdict **)(this + 0x30);
        if (pCVar2 != (CBaseEdict *)0x0) {
          *(uint *)pCVar2 = *(uint *)pCVar2 | 0x101;
          iVar5 = CBaseEdict::GetChangeAccessor(pCVar2);
          *(undefined2 *)(iVar5 + 2) = 0;
        }
      }
      else {
        this[0x70] = (CTerrorPlayer)((byte)this[0x70] | 1);
      }
      this[0x33a8] = (CTerrorPlayer)0x0;
    }
  }
  else {
    pcVar1 = *(code **)(*(int *)this + 0x1dc);
    if (((byte)param_1[0x14d] & 8) != 0) {
      CBaseEntity::CalcAbsolutePosition((CBaseEntity *)param_1);
    }
    (*pcVar1)(this,param_1 + 0x2e0,&vec3_angle,&vec3_origin);
    CBasePlayer::EnableControl((CBasePlayer *)this,false);
    (**(code **)(*(int *)this + 0x98))(this,param_1,0xffffffff);
    puVar4 = (undefined4 *)(**(code **)(*(int *)this + 0xc))(this);
    *(undefined4 *)(param_1 + 0x444) = *puVar4;
    uVar8 = *(uint *)(this + 0x1a7c) | 0x77b;
    if (*(uint *)(this + 0x1a7c) != uVar8) {
      (**(code **)(*(int *)(this + 0x1a40) + 4))(this + 0x1a40,this + 0x1a7c);
      *(uint *)(this + 0x1a7c) = uVar8;
    }
    CVar3 = (CTerrorPlayer)CSurvivorPosition::ShouldHideWeapons(param_1);
    if (CVar3 != this[0x33a8]) {
      if (this[0x6c] == (CTerrorPlayer)0x0) {
        pCVar2 = *(CBaseEdict **)(this + 0x30);
        if (pCVar2 != (CBaseEdict *)0x0) {
          *(uint *)pCVar2 = *(uint *)pCVar2 | 0x101;
          iVar5 = CBaseEdict::GetChangeAccessor(pCVar2);
          *(undefined2 *)(iVar5 + 2) = 0;
        }
      }
      else {
        this[0x70] = (CTerrorPlayer)((byte)this[0x70] | 1);
      }
      this[0x33a8] = CVar3;
    }
  }
  CHandle<CBaseEntity>::CHandle((CHandle<CBaseEntity> *)local_20,(CBaseEntity *)param_1);
  if (((local_20[0] == 0xffffffff) ||
      (puVar7 = g_pEntityList + (local_20[0] & 0xfff) * 0x10, puVar7 == (undefined *)0xfffffffc)) ||
     (*(uint *)(puVar7 + 8) != local_20[0] >> 0xc)) {
    iVar5 = 0;
  }
  else {
    iVar5 = *(int *)(puVar7 + 4);
  }
  uVar8 = *(uint *)(this + 0x33a4);
  if (((uVar8 == 0xffffffff) ||
      (puVar7 = g_pEntityList + (uVar8 & 0xfff) * 0x10, puVar7 == (undefined *)0xfffffffc)) ||
     (*(uint *)(puVar7 + 8) != uVar8 >> 0xc)) {
    iVar6 = 0;
  }
  else {
    iVar6 = *(int *)(puVar7 + 4);
  }
  if (iVar5 == iVar6) {
    return;
  }
  if (this[0x6c] == (CTerrorPlayer)0x0) {
    pCVar2 = *(CBaseEdict **)(this + 0x30);
    if (pCVar2 != (CBaseEdict *)0x0) {
      *(uint *)pCVar2 = *(uint *)pCVar2 | 0x101;
      iVar5 = CBaseEdict::GetChangeAccessor(pCVar2);
      *(undefined2 *)(iVar5 + 2) = 0;
    }
    *(uint *)(this + 0x33a4) = local_20[0];
  }
  else {
    this[0x70] = (CTerrorPlayer)((byte)this[0x70] | 1);
    *(uint *)(this + 0x33a4) = local_20[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)