L L4D2node

CBasePlayer::GetInVehicle

0x007b0090 · 1028 bytes · __thiscall

_ZN11CBasePlayer12GetInVehicleEP14IServerVehiclei

Decompiled

undefined (3 params)

/* CBasePlayer::GetInVehicle(IServerVehicle*, int) */

undefined4 __thiscall
CBasePlayer::GetInVehicle(CBasePlayer *this,IServerVehicle *param_1,int param_2)

{
  code *pcVar1;
  uint uVar2;
  CBaseEdict *this_00;
  char cVar3;
  undefined4 uVar4;
  int *piVar5;
  undefined4 uVar6;
  int iVar7;
  undefined4 *puVar8;
  uint uVar9;
  int *piVar10;
  undefined *puVar11;
  Vector local_34 [12];
  QAngle local_28 [24];
  
  uVar4 = CanEnterVehicle(this,param_1,param_2);
  if ((char)uVar4 == '\0') {
    return uVar4;
  }
  piVar5 = (int *)(**(code **)(*(int *)param_1 + 0x20))(param_1);
  cVar3 = (**(code **)(*(int *)param_1 + 0xc))(param_1,param_2);
  if (cVar3 == '\0') {
    piVar10 = (int *)CBaseCombatCharacter::GetActiveWeapon((CBaseCombatCharacter *)this);
    if (piVar10 != (int *)0x0) {
      (**(code **)(*piVar10 + 0x428))(piVar10,0);
    }
    uVar2 = *(uint *)(this + 0x1a7c);
    uVar9 = uVar2 | 1;
    if (uVar2 != uVar9) {
      (**(code **)(*(int *)(this + 0x1a40) + 4))(this + 0x1a40,this + 0x1a7c);
      *(uint *)(this + 0x1a7c) = uVar9;
    }
    if ((uVar2 | 0x401) != uVar9) {
      (**(code **)(*(int *)(this + 0x1a40) + 4))(this + 0x1a40,this + 0x1a7c);
      *(uint *)(this + 0x1a7c) = uVar2 | 0x401;
    }
  }
  cVar3 = (**(code **)(*(int *)param_1 + 0x28))(param_1,param_2);
  if (cVar3 == '\0') {
    CBaseEntity::AddEffects((CBaseEntity *)this,0x20);
  }
  (**(code **)(*(int *)param_1 + 0x24))(param_1,param_2,this);
  ViewPunchReset(this,0.0);
  CBaseEntity::SetAbsVelocity((CBaseEntity *)this,(Vector *)&vec3_origin);
  CBaseEntity::SetMoveType((CBaseEntity *)this,8,0);
  (**(code **)(*(int *)gamestats + 0x8c))(gamestats,this);
  (**(code **)(*(int *)param_1 + 0x40))(param_1,param_2,local_34,local_28);
  CBaseEntity::SetAbsOrigin((CBaseEntity *)this,local_34);
  CBaseEntity::SetAbsAngles((CBaseEntity *)this,local_28);
  (**(code **)(*(int *)this + 0x98))(this,piVar5,0xffffffff);
  CBaseEntity::SetCollisionGroup((CBaseEntity *)this,10);
  CBaseEntity::RemoveFlag((CBaseEntity *)this,2);
  pcVar1 = *(code **)(*(int *)this + 0x254);
  uVar6 = (**(code **)(*g_pGameRules + 0x7c))(g_pGameRules);
  (*pcVar1)(this,uVar6);
  if (this[0x1a90] != (CBasePlayer)0x0) {
    (**(code **)(*(int *)(this + 0x1a40) + 4))(this + 0x1a40,this + 0x1a90);
    this[0x1a90] = (CBasePlayer)0x0;
  }
  if (this[0x1a91] != (CBasePlayer)0x0) {
    (**(code **)(*(int *)(this + 0x1a40) + 4))(this + 0x1a40,this + 0x1a91);
    this[0x1a91] = (CBasePlayer)0x0;
  }
  if (*(int *)(this + 0x1a94) != 0) {
    (**(code **)(*(int *)(this + 0x1a40) + 4))(this + 0x1a40,this + 0x1a94);
    *(undefined4 *)(this + 0x1a94) = 0;
  }
  if (*(int *)(this + 0x1a98) != 0) {
    (**(code **)(*(int *)(this + 0x1a40) + 4))(this + 0x1a40,this + 0x1a98);
    *(undefined4 *)(this + 0x1a98) = 0;
  }
  if (*(int *)(this + 0x1a9c) != 0) {
    (**(code **)(*(int *)(this + 0x1a40) + 4))(this + 0x1a40,this + 0x1a9c);
    *(undefined4 *)(this + 0x1a9c) = 0;
  }
  if (this[0x2034] != (CBasePlayer)0x0) {
    this[0x2034] = (CBasePlayer)0x0;
  }
  uVar2 = *(uint *)(this + 0x1d24);
  piVar10 = (int *)0x0;
  if (((uVar2 != 0xffffffff) &&
      (puVar11 = g_pEntityList + (uVar2 & 0xfff) * 0x10, puVar11 != (undefined *)0xfffffffc)) &&
     (*(uint *)(puVar11 + 8) == uVar2 >> 0xc)) {
    piVar10 = *(int **)(puVar11 + 4);
  }
  if (piVar5 != piVar10) {
    if (this[0x6c] == (CBasePlayer)0x0) {
      this_00 = *(CBaseEdict **)(this + 0x30);
      if (this_00 != (CBaseEdict *)0x0) {
        *(uint *)this_00 = *(uint *)this_00 | 0x101;
        iVar7 = CBaseEdict::GetChangeAccessor(this_00);
        *(undefined2 *)(iVar7 + 2) = 0;
      }
    }
    else {
      this[0x70] = (CBasePlayer)((byte)this[0x70] | 1);
    }
    if (piVar5 == (int *)0x0) {
      *(undefined4 *)(this + 0x1d24) = 0xffffffff;
    }
    else {
      puVar8 = (undefined4 *)(**(code **)(*piVar5 + 0xc))(piVar5);
      *(undefined4 *)(this + 0x1d24) = *puVar8;
    }
  }
  (**(code **)(*(int *)g_pNotify + 8))(g_pNotify,this,"PlayerEnteredVehicle");
  *(undefined4 *)(this + 0x1d28) = 0;
  (**(code **)(*(int *)this + 0x6a4))(this);
  return uVar4;
}

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)