CBaseServerVehicle::GetPassengerExitPoint
0x00b374e0 · 2490 bytes · __thiscall
_ZN18CBaseServerVehicle21GetPassengerExitPointEiP6VectorP6QAngle
Decompiled
undefined (4 params)
/* WARNING: Removing unreachable block (ram,0x00b37731) */
/* WARNING: Removing unreachable block (ram,0x00b376e4) */
/* WARNING: Removing unreachable block (ram,0x00b37e98) */
/* WARNING: Removing unreachable block (ram,0x00b37e91) */
/* CBaseServerVehicle::GetPassengerExitPoint(int, Vector*, QAngle*) */
uint __thiscall
CBaseServerVehicle::GetPassengerExitPoint
(CBaseServerVehicle *this,int param_1,Vector *param_2,QAngle *param_3)
{
IHandleEntity *pIVar1;
IHandleEntity *pIVar2;
char cVar3;
CBaseAnimating *this_00;
uint uVar4;
int iVar5;
int iVar6;
int iVar7;
float *pfVar8;
matrix3x4_t *pmVar9;
int iVar10;
float local_f4;
float local_f0;
float local_ec;
float local_e8;
float local_e4;
float local_e0;
CTraceFilterSimple local_dc [16];
float local_cc;
float local_c8;
float local_c4;
float local_bc;
float local_b8;
float local_b4;
float local_ac;
float local_a8;
float local_a4;
float local_9c;
float local_98;
float local_94;
undefined4 local_8c;
undefined1 local_88;
undefined1 local_87;
Vector local_70 [12];
undefined4 local_64;
undefined4 local_60;
undefined4 local_5c;
byte local_39;
if (((*(int *)(this + 0x2c) != 0) &&
(this_00 = (CBaseAnimating *)
__dynamic_cast(*(int *)(this + 0x2c),&CBaseEntity::typeinfo,
&CBaseAnimating::typeinfo,0), this_00 != (CBaseAnimating *)0x0)) &&
(uVar4 = CBaseAnimating::GetAttachment
(this_00,"vehicle_driver_exit",(Vector *)&local_f4,(QAngle *)&local_e8),
(char)uVar4 != '\0')) {
pIVar1 = *(IHandleEntity **)(this + 0x2c);
iVar5 = (**(code **)(*g_pGameRules + 0x7c))(g_pGameRules);
iVar6 = (**(code **)(*g_pGameRules + 0x7c))(g_pGameRules);
local_87 = 1;
local_bc = 0.0;
local_b8 = 0.0;
local_b4 = -12.0;
local_8c = 0;
local_9c = (*(float *)(iVar5 + 0x18) - *(float *)(iVar6 + 0xc)) * 0.5;
local_98 = (*(float *)(iVar5 + 0x1c) - *(float *)(iVar6 + 0x10)) * 0.5;
local_94 = (*(float *)(iVar5 + 0x20) - *(float *)(iVar6 + 0x14)) * 0.5;
local_88 = local_9c * local_9c + local_98 * local_98 + local_94 * local_94 < 1e-06;
local_ac = (*(float *)(iVar5 + 0x18) + *(float *)(iVar6 + 0xc)) * 0.5;
local_cc = local_f4 + local_ac;
local_a8 = (*(float *)(iVar5 + 0x1c) + *(float *)(iVar6 + 0x10)) * 0.5;
local_c8 = local_f0 + local_a8;
local_a4 = (*(float *)(iVar5 + 0x20) + *(float *)(iVar6 + 0x14)) * 0.5;
local_c4 = local_ec + 12.0 + local_a4;
local_ac = -local_ac;
local_a8 = -local_a8;
local_a4 = -local_a4;
CTraceFilterSimple::CTraceFilterSimple
(local_dc,pIVar1,0,(_func_bool_IHandleEntity_ptr_int *)0x0);
(**(code **)(*enginetrace + 0x14))(enginetrace,&local_cc,0x201400b,local_dc,local_70);
if (*(int *)(r_visualizetraces._28_4_ + 0x30) != 0) {
DebugDrawLine(local_70,(Vector *)&local_64,0xff,0xff,0,true,-1.0);
}
if (local_39 == 0) {
*(float *)param_3 = local_e8;
*(float *)(param_3 + 4) = local_e4;
*(float *)(param_3 + 8) = local_e0;
*(undefined4 *)param_2 = local_64;
*(undefined4 *)(param_2 + 4) = local_60;
*(undefined4 *)(param_2 + 8) = local_5c;
return uVar4;
}
}
cVar3 = (**(code **)(*(int *)this + 0xf8))(this,0x42b40000,0x5a,param_2);
if (((cVar3 == '\0') &&
(cVar3 = (**(code **)(*(int *)this + 0xf8))(this,0xc2b40000,0x5a,param_2), cVar3 == '\0')) &&
((cVar3 = (**(code **)(*(int *)this + 0xf8))(this,0,100,param_2), cVar3 == '\0' &&
(cVar3 = (**(code **)(*(int *)this + 0xf8))(this,0x43340000,0xaa,param_2), cVar3 == '\0')))) {
iVar5 = *(int *)(this + 0x2c);
CCollisionProperty::CollisionAABBToWorldAABB
((CCollisionProperty *)(iVar5 + 0x194),(Vector *)(iVar5 + 0x19c),
(Vector *)(iVar5 + 0x1a8),(Vector *)&local_f4,(Vector *)&local_e8);
*(float *)param_2 = (local_e8 + local_f4) * 0.5;
*(float *)(param_2 + 4) = (local_e4 + local_f0) * 0.5;
*(float *)(param_2 + 8) = local_e0 + 50.0;
iVar5 = (**(code **)(*g_pGameRules + 0x7c))(g_pGameRules);
iVar6 = (**(code **)(*g_pGameRules + 0x7c))(g_pGameRules);
pIVar2 = *(IHandleEntity **)(this + 0x2c);
pIVar1 = pIVar2 + 0x194;
if ((AllocTempVector()::s_vecTemp == '\0') &&
(iVar7 = __cxa_guard_acquire(&AllocTempVector()::s_vecTemp), iVar7 != 0)) {
__cxa_guard_release(&AllocTempVector()::s_vecTemp);
}
if ((AllocTempVector()::s_nIndex == '\0') &&
(iVar7 = __cxa_guard_acquire(&AllocTempVector()::s_nIndex), iVar7 != 0)) {
AllocTempVector()::s_nIndex = 0;
__cxa_guard_release(&AllocTempVector()::s_nIndex);
}
AllocTempVector()::s_nIndex = AllocTempVector()::s_nIndex + 0x10001 & 0x7f;
LOCK();
UNLOCK();
iVar7 = AllocTempVector()::s_nIndex * 0xc;
if ((AllocTempVector()::s_vecTemp == '\0') &&
(iVar10 = __cxa_guard_acquire(&AllocTempVector()::s_vecTemp), iVar10 != 0)) {
__cxa_guard_release(&AllocTempVector()::s_vecTemp);
}
if ((AllocTempVector()::s_nIndex == '\0') &&
(iVar10 = __cxa_guard_acquire(&AllocTempVector()::s_nIndex), iVar10 != 0)) {
AllocTempVector()::s_nIndex = 0;
__cxa_guard_release(&AllocTempVector()::s_nIndex);
}
AllocTempVector()::s_nIndex = AllocTempVector()::s_nIndex + 0x10001 & 0x7f;
LOCK();
UNLOCK();
iVar10 = AllocTempVector()::s_nIndex * 0xc;
*(float *)(AllocTempVector()::s_vecTemp + iVar10) =
(*(float *)(pIVar2 + 0x1a8) - *(float *)(pIVar2 + 0x19c)) * 0.5 +
*(float *)(pIVar2 + 0x19c);
*(float *)(AllocTempVector()::s_vecTemp + iVar10 + 4) =
(*(float *)(pIVar2 + 0x1ac) - *(float *)(pIVar2 + 0x1a0)) * 0.5 +
*(float *)(pIVar2 + 0x1a0);
*(float *)(AllocTempVector()::s_vecTemp + iVar10 + 8) =
(*(float *)(pIVar2 + 0x1b0) - *(float *)(pIVar2 + 0x1a4)) * 0.5 +
*(float *)(pIVar2 + 0x1a4);
if (((((byte)pIVar2[0x1b4] & 0x40) == 0) && (((byte)pIVar2[0x1b6] & 0xfd) != 0)) &&
((pfVar8 = (float *)(**(code **)(*(int *)(pIVar2 + 0x194) + 0x24))(pIVar1),
vec3_angle != *pfVar8 || ((DAT_01053d40 != pfVar8[1] || (DAT_01053d44 != pfVar8[2])))))) {
pmVar9 = (matrix3x4_t *)(**(code **)(*(int *)(pIVar2 + 0x194) + 0x28))(pIVar1);
VectorTransform((float *)(AllocTempVector()::s_vecTemp + iVar10),pmVar9,
(float *)(AllocTempVector()::s_vecTemp + iVar7));
local_c8 = *(float *)(AllocTempVector()::s_vecTemp + iVar7 + 4);
local_cc = *(float *)(AllocTempVector()::s_vecTemp + iVar7);
local_c4 = *(float *)(AllocTempVector()::s_vecTemp + iVar7 + 8);
}
else {
pfVar8 = (float *)(**(code **)(*(int *)(pIVar2 + 0x194) + 0x20))(pIVar1);
local_cc = *pfVar8 + *(float *)(AllocTempVector()::s_vecTemp + iVar10);
*(float *)(AllocTempVector()::s_vecTemp + iVar7) = local_cc;
local_c8 = pfVar8[1] + *(float *)(AllocTempVector()::s_vecTemp + iVar10 + 4);
*(float *)(AllocTempVector()::s_vecTemp + iVar7 + 4) = local_c8;
local_c4 = pfVar8[2] + *(float *)(AllocTempVector()::s_vecTemp + iVar10 + 8);
*(float *)(AllocTempVector()::s_vecTemp + iVar7 + 8) = local_c4;
}
local_8c = 0;
local_bc = *(float *)param_2 - local_cc;
local_b8 = *(float *)(param_2 + 4) - local_c8;
local_b4 = *(float *)(param_2 + 8) - local_c4;
local_87 = local_b8 * local_b8 + local_bc * local_bc + local_b4 * local_b4 != 0.0;
local_9c = (*(float *)(iVar5 + 0x18) - *(float *)(iVar6 + 0xc)) * 0.5;
local_98 = (*(float *)(iVar5 + 0x1c) - *(float *)(iVar6 + 0x10)) * 0.5;
local_94 = (*(float *)(iVar5 + 0x20) - *(float *)(iVar6 + 0x14)) * 0.5;
local_88 = local_9c * local_9c + local_98 * local_98 + local_94 * local_94 < 1e-06;
local_ac = (*(float *)(iVar5 + 0x18) + *(float *)(iVar6 + 0xc)) * 0.5;
local_cc = local_cc + local_ac;
local_a8 = (*(float *)(iVar5 + 0x1c) + *(float *)(iVar6 + 0x10)) * 0.5;
local_c8 = local_c8 + local_a8;
local_a4 = (*(float *)(iVar5 + 0x20) + *(float *)(iVar6 + 0x14)) * 0.5;
local_c4 = local_c4 + local_a4;
local_ac = -local_ac;
local_a8 = -local_a8;
local_a4 = -local_a4;
CTraceFilterSimple::CTraceFilterSimple
(local_dc,pIVar2,0,(_func_bool_IHandleEntity_ptr_int *)0x0);
(**(code **)(*enginetrace + 0x14))(enginetrace,&local_cc,0x201400b,local_dc,local_70);
if (*(int *)(r_visualizetraces._28_4_ + 0x30) != 0) {
DebugDrawLine(local_70,(Vector *)&local_64,0xff,0xff,0,true,-1.0);
}
uVar4 = local_39 ^ 1;
}
else {
uVar4 = 1;
}
return uVar4;
}
SourceMod gamedata
paste intoaddons/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.
Signatures + Functions block. The plugin uses
DHookCreateFromConf - DHooks reads return type, this-type,
calling convention, and argument types straight from the gamedata. Less
boilerplate in the plugin, types travel with the gamedata.
Gamedata KeyValues
DHooks plugin example
Type inference is best-effort from the C signature - sanity-check the DHooks types before shipping.