L L4D2node

CBasePlayer::LeaveVehicle

0x007b1dd0 · 1113 bytes · __thiscall

_ZN11CBasePlayer12LeaveVehicleERK6VectorRK6QAngle

Decompiled

undefined (3 params)

/* CBasePlayer::LeaveVehicle(Vector const&, QAngle const&) */

void __thiscall CBasePlayer::LeaveVehicle(CBasePlayer *this,Vector *param_1,QAngle *param_2)

{
  int *piVar1;
  CBaseEdict *pCVar2;
  char cVar3;
  int *piVar4;
  undefined4 uVar5;
  uint *puVar6;
  int iVar7;
  undefined *puVar8;
  uint uVar9;
  uint uVar10;
  float fVar11;
  float fVar12;
  Vector *local_40;
  float local_34;
  float local_30;
  float local_2c;
  undefined4 local_28;
  undefined4 local_24;
  undefined4 local_20;
  
  uVar10 = *(uint *)(this + 0x1d24);
  if ((((uVar10 == 0xffffffff) ||
       (puVar8 = g_pEntityList + (uVar10 & 0xfff) * 0x10, puVar8 == (undefined *)0xfffffffc)) ||
      (*(uint *)(puVar8 + 8) != uVar10 >> 0xc)) || (*(int *)(puVar8 + 4) == 0)) {
    return;
  }
  piVar4 = (int *)(**(code **)(*(int *)this + 0x500))(this);
  uVar5 = (**(code **)(*piVar4 + 4))(piVar4,this);
  (**(code **)(*(int *)this + 0x98))(this,0,0xffffffff);
  if (((byte)this[0x14d] & 8) == 0) {
    local_34 = *(float *)(this + 0x2e0);
    local_30 = *(float *)(this + 0x2e4);
    local_2c = *(float *)(this + 0x2e8);
  }
  else {
    CBaseEntity::CalcAbsolutePosition((CBaseEntity *)this);
    local_34 = *(float *)(this + 0x2e0);
    local_30 = *(float *)(this + 0x2e4);
    local_2c = *(float *)(this + 0x2e8);
    if ((*(uint *)(this + 0x14c) & 0x800) != 0) {
      CBaseEntity::CalcAbsolutePosition((CBaseEntity *)this);
    }
  }
  local_28 = *(undefined4 *)(this + 0x37c);
  local_24 = *(undefined4 *)(this + 0x380);
  local_20 = *(undefined4 *)(this + 900);
  if (*(float *)param_1 == vec3_origin) {
    fVar12 = *(float *)(param_1 + 4);
    if (DAT_01053d4c != fVar12) goto LAB_007b20e0;
    fVar11 = *(float *)(param_1 + 8);
    fVar12 = DAT_01053d4c;
    if (fVar11 == DAT_01053d50) {
      (**(code **)(*piVar4 + 0x4c))(piVar4,uVar5,&local_34,&local_28);
      goto LAB_007b1f00;
    }
  }
  else {
    fVar12 = *(float *)(param_1 + 4);
LAB_007b20e0:
    fVar11 = *(float *)(param_1 + 8);
  }
  local_28 = *(undefined4 *)param_2;
  local_24 = *(undefined4 *)(param_2 + 4);
  local_20 = *(undefined4 *)(param_2 + 8);
  local_34 = *(float *)param_1;
  local_30 = fVar12;
  local_2c = fVar11;
LAB_007b1f00:
  local_40 = (Vector *)&local_34;
  (**(code **)(*(int *)this + 0x6a8))(this,local_40);
  CBaseEntity::SetAbsOrigin((CBaseEntity *)this,local_40);
  CBaseEntity::SetAbsAngles((CBaseEntity *)this,(QAngle *)&local_28);
  CBaseEntity::SetAbsVelocity((CBaseEntity *)this,(Vector *)&vec3_origin);
  uVar10 = *(uint *)(this + 0x1a7c);
  local_20 = 0;
  *(undefined4 *)(this + 0x1c84) = local_28;
  *(undefined4 *)(this + 0x1c8c) = 0;
  *(undefined4 *)(this + 0x1c88) = local_24;
  *(undefined4 *)(this + 0x1c94) = 1;
  uVar9 = uVar10 & 0xfffffffe;
  if (uVar10 != uVar9) {
    (**(code **)(*(int *)(this + 0x1a40) + 4))(this + 0x1a40,this + 0x1a7c);
    *(uint *)(this + 0x1a7c) = uVar9;
  }
  if ((uVar10 & 0xfffffbfe) != uVar9) {
    (**(code **)(*(int *)(this + 0x1a40) + 4))(this + 0x1a40,this + 0x1a7c);
    *(uint *)(this + 0x1a7c) = uVar10 & 0xfffffbfe;
  }
  uVar10 = *(uint *)(this + 0xd4) & 0xffffffdf;
  if (*(uint *)(this + 0xd4) == uVar10) {
    puVar6 = *(uint **)(this + 0x30);
  }
  else {
    if (this[0x6c] == (CBasePlayer)0x0) {
      pCVar2 = *(CBaseEdict **)(this + 0x30);
      puVar6 = (uint *)0x0;
      if (pCVar2 != (CBaseEdict *)0x0) {
        *(uint *)pCVar2 = *(uint *)pCVar2 | 0x101;
        iVar7 = CBaseEdict::GetChangeAccessor(pCVar2);
        *(undefined2 *)(iVar7 + 2) = 0;
        puVar6 = *(uint **)(this + 0x30);
      }
    }
    else {
      this[0x70] = (CBasePlayer)((byte)this[0x70] | 1);
      puVar6 = *(uint **)(this + 0x30);
    }
    *(uint *)(this + 0xd4) = uVar10;
  }
  if (puVar6 != (uint *)0x0) {
    *puVar6 = *puVar6 | 0x80;
  }
  CBaseEntity::DispatchUpdateTransmitState((CBaseEntity *)this);
  CBaseEntity::SetMoveType((CBaseEntity *)this,2,0);
  CBaseEntity::SetCollisionGroup((CBaseEntity *)this,5);
  piVar1 = *(int **)(this + 0x238);
  if (piVar1 != (int *)0x0) {
    (**(code **)(*piVar1 + 0xbc))(piVar1,local_40,&vec3_angle,1);
  }
  uVar10 = *(uint *)(this + 0x1d24);
  if (((uVar10 != 0xffffffff) &&
      (puVar8 = g_pEntityList + (uVar10 & 0xfff) * 0x10, puVar8 != (undefined *)0xfffffffc)) &&
     ((*(uint *)(puVar8 + 8) == uVar10 >> 0xc && (*(int *)(puVar8 + 4) != 0)))) {
    if (this[0x6c] == (CBasePlayer)0x0) {
      pCVar2 = *(CBaseEdict **)(this + 0x30);
      if (pCVar2 != (CBaseEdict *)0x0) {
        *(uint *)pCVar2 = *(uint *)pCVar2 | 0x101;
        iVar7 = CBaseEdict::GetChangeAccessor(pCVar2);
        *(undefined2 *)(iVar7 + 2) = 0;
      }
    }
    else {
      this[0x70] = (CBasePlayer)((byte)this[0x70] | 1);
    }
    *(undefined4 *)(this + 0x1d24) = 0xffffffff;
  }
  (**(code **)(*piVar4 + 0x24))(piVar4,uVar5,0);
  cVar3 = (**(code **)(*(int *)this + 300))(this);
  if (cVar3 != '\0') {
    iVar7 = CBaseCombatCharacter::GetActiveWeapon((CBaseCombatCharacter *)this);
    if (iVar7 != 0) {
      piVar4 = (int *)CBaseCombatCharacter::GetActiveWeapon((CBaseCombatCharacter *)this);
      cVar3 = (**(code **)(*piVar4 + 0x434))(piVar4);
      if (cVar3 == '\0') {
        piVar4 = (int *)CBaseCombatCharacter::GetActiveWeapon((CBaseCombatCharacter *)this);
        (**(code **)(*piVar4 + 0x424))(piVar4);
        ShowCrosshair(this,true);
      }
    }
  }
  RumbleEffect(this,'\0','\0','\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)