CBaseServerVehicle::GetExitAnimToUse
0x00b383d0 · 4077 bytes · __thiscall
_ZN18CBaseServerVehicle16GetExitAnimToUseER6VectorRb
Decompiled
undefined (3 params)
/* CBaseServerVehicle::GetExitAnimToUse(Vector&, bool&) */
undefined4 __thiscall
CBaseServerVehicle::GetExitAnimToUse(CBaseServerVehicle *this,Vector *param_1,bool *param_2)
{
float fVar1;
float fVar2;
float fVar3;
char cVar4;
char cVar5;
CBaseEntity *this_00;
CBasePlayer *this_01;
undefined4 uVar6;
char *pcVar7;
float *pfVar8;
int iVar9;
int iVar10;
int iVar11;
int *piVar12;
int iVar13;
int iVar14;
float fVar15;
float local_170;
int local_160;
float local_15c;
float local_158;
float local_154;
char local_13e;
float local_13c;
float local_138;
float local_134;
float local_130;
float local_12c;
float local_128;
float local_124;
float local_120;
float local_11c;
undefined4 local_118;
undefined4 local_114;
undefined4 local_110;
float local_10c;
float local_108;
float local_104;
float local_100;
float local_fc;
float local_f8;
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;
float local_70;
float local_6c;
float local_68;
float local_64;
float local_60;
float local_5c;
float local_44;
char local_3a;
char local_39;
*param_2 = false;
if (this[0x68] == (CBaseServerVehicle)0x0) {
(**(code **)(*(int *)this + 0xf4))(this);
this[0x68] = (CBaseServerVehicle)0x1;
}
if (((*(int *)(this + 0x60) != 0) && (*(int *)(this + 0x2c) != 0)) &&
(this_00 = (CBaseEntity *)
__dynamic_cast(*(int *)(this + 0x2c),&CBaseEntity::typeinfo,
&CBaseAnimating::typeinfo,0), this_00 != (CBaseEntity *)0x0)) {
piVar12 = *(int **)(this_00 + 0x13e0);
if (piVar12 == (int *)0x0) {
iVar10 = CBaseEntity::GetModel(this_00);
if (iVar10 == 0) {
piVar12 = *(int **)(this_00 + 0x13e0);
}
else {
CBaseAnimating::LockStudioHdr((CBaseAnimating *)this_00);
piVar12 = *(int **)(this_00 + 0x13e0);
}
if (piVar12 == (int *)0x0) {
return 0xffffffff;
}
}
if (*piVar12 != 0) {
cVar4 = (**(code **)(*(int *)this + 0x34))(this);
this_01 = (CBasePlayer *)(**(code **)(*(int *)this + 0xf0))(this);
if ((this_01 != (CBasePlayer *)0x0) &&
(cVar5 = (**(code **)(*(int *)this_01 + 0x16c))(this_01), cVar5 != '\0')) {
uVar6 = (**(code **)(*(int *)this + 4))(this,this_01);
(**(code **)(*(int *)this_01 + 0x234))(&local_70,this_01);
local_130 = local_70;
local_12c = local_6c;
local_128 = local_68;
CBasePlayer::EyeVectors(this_01,(Vector *)&local_13c,(Vector *)0x0,(Vector *)0x0);
local_134 = 0.0;
VectorNormalize((Vector *)&local_13c);
iVar10 = *(int *)(this + 0x60);
if (0 < iVar10) {
iVar14 = 0;
local_15c = 0.0;
local_158 = 0.0;
local_154 = 0.0;
local_170 = -2.0;
local_13e = '\x01';
local_160 = -1;
do {
while( true ) {
iVar13 = iVar14 * 0x9c;
pcVar7 = (char *)(*(int *)(this + 0x54) + iVar13);
if ((cVar4 != *pcVar7) || ((local_13e == '\0' && (pcVar7[1] != '\0'))))
goto LAB_00b38570;
if (this[0x69] == (CBaseServerVehicle)0x0) {
local_124 = *(float *)(pcVar7 + 0x84);
local_120 = *(float *)(pcVar7 + 0x88);
local_11c = *(float *)(pcVar7 + 0x8c);
local_118 = *(undefined4 *)(pcVar7 + 0x90);
local_114 = *(undefined4 *)(pcVar7 + 0x94);
local_110 = *(undefined4 *)(pcVar7 + 0x98);
UTIL_ParentToWorldSpace(this_00,(Vector *)&local_124,(QAngle *)&local_118);
}
else {
CBaseAnimating::GetAttachment
((CBaseAnimating *)this_00,pcVar7 + 2,(Vector *)&local_124,
(QAngle *)&local_118);
}
local_104 = 0.0;
local_10c = local_124 - local_130;
local_108 = local_120 - local_12c;
VectorNormalize((Vector *)&local_10c);
fVar15 = local_138 * local_108 + local_13c * local_10c + local_134 * local_104;
if (((local_13e == '\0') || (*(char *)(*(int *)(this + 0x54) + 1 + iVar13) != '\0'))
&& (fVar15 < local_170)) break;
pfVar8 = (float *)(**(code **)(*g_pGameRules + 0x7c))(g_pGameRules);
local_11c = local_11c - pfVar8[2];
local_124 = local_124 - *pfVar8;
local_120 = local_120 - pfVar8[1];
local_f8 = local_11c + 64.0;
local_ec = local_11c - 64.0;
local_100 = local_124;
local_fc = local_120;
local_f4 = local_124;
local_f0 = local_120;
iVar9 = (**(code **)(*g_pGameRules + 0x7c))(g_pGameRules);
fVar1 = *(float *)(iVar9 + 0x14);
iVar9 = (**(code **)(*g_pGameRules + 0x7c))(g_pGameRules);
fVar2 = *(float *)(iVar9 + 0x1c);
iVar9 = (**(code **)(*g_pGameRules + 0x7c))(g_pGameRules);
fVar3 = *(float *)(iVar9 + 0x18);
iVar9 = (**(code **)(*g_pGameRules + 0x7c))(g_pGameRules);
local_8c = 0;
local_bc = local_f4 - local_100;
local_b8 = local_f0 - local_fc;
local_b4 = local_ec - local_f8;
local_87 = local_b8 * local_b8 + local_bc * local_bc + local_b4 * local_b4 != 0.0;
local_9c = (fVar3 - *(float *)(iVar9 + 0xc)) * 0.5;
local_98 = (fVar2 - *(float *)(iVar9 + 0x10)) * 0.5;
local_94 = (fVar1 - *(float *)(iVar9 + 0x14)) * 0.5;
local_88 = local_9c * local_9c + local_98 * local_98 + local_94 * local_94 < 1e-06;
local_ac = (fVar3 + *(float *)(iVar9 + 0xc)) * 0.5;
local_a8 = (fVar2 + *(float *)(iVar9 + 0x10)) * 0.5;
local_cc = local_100 + local_ac;
local_ac = -local_ac;
local_c8 = local_fc + local_a8;
local_a8 = -local_a8;
local_a4 = (*(float *)(iVar9 + 0x14) + fVar1) * 0.5;
local_c4 = local_f8 + local_a4;
local_a4 = -local_a4;
CTraceFilterSimple::CTraceFilterSimple
(local_dc,(IHandleEntity *)0x0,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((Vector *)&local_70,(Vector *)&local_64,0xff,0xff,0,true,-1.0);
}
if (*(int *)(g_debug_vehicleexit._28_4_ + 0x30) != 0) {
iVar9 = (**(code **)(*g_pGameRules + 0x7c))(g_pGameRules);
fVar1 = *(float *)(iVar9 + 0x10);
iVar9 = (**(code **)(*g_pGameRules + 0x7c))(g_pGameRules);
fVar2 = *(float *)(iVar9 + 0x1c);
iVar9 = (**(code **)(*g_pGameRules + 0x7c))(g_pGameRules);
local_cc = *(float *)(iVar9 + 0x18);
local_c8 = fVar2;
local_c4 = fVar1;
iVar9 = (**(code **)(*g_pGameRules + 0x7c))(g_pGameRules);
NDebugOverlay::SweptBox
((Vector *)&local_100,(Vector *)&local_f4,(Vector *)(iVar9 + 0xc),
(Vector *)&local_cc,(QAngle *)&vec3_angle,0xff,0xff,0xff,8,20.0);
}
if (local_44 < 1.0) {
iVar9 = (**(code **)(*g_pGameRules + 0x7c))(g_pGameRules);
iVar11 = (**(code **)(*g_pGameRules + 0x7c))(g_pGameRules);
local_87 = 0;
local_bc = 0.0;
local_b8 = 0.0;
local_b4 = 0.0;
local_8c = 0;
local_9c = (*(float *)(iVar9 + 0x18) - *(float *)(iVar11 + 0xc)) * 0.5;
local_98 = (*(float *)(iVar9 + 0x1c) - *(float *)(iVar11 + 0x10)) * 0.5;
local_94 = (*(float *)(iVar9 + 0x20) - *(float *)(iVar11 + 0x14)) * 0.5;
local_88 = local_98 * local_98 + local_9c * local_9c + local_94 * local_94 < 1e-06;
local_ac = (*(float *)(iVar9 + 0x18) + *(float *)(iVar11 + 0xc)) * 0.5;
local_cc = local_64 + local_ac;
local_a8 = (*(float *)(iVar9 + 0x1c) + *(float *)(iVar11 + 0x10)) * 0.5;
local_c8 = local_60 + local_a8;
local_a4 = (*(float *)(iVar9 + 0x20) + *(float *)(iVar11 + 0x14)) * 0.5;
local_c4 = local_5c + local_a4;
local_ac = -local_ac;
local_a8 = -local_a8;
local_a4 = -local_a4;
CTraceFilterSimple::CTraceFilterSimple
(local_dc,(IHandleEntity *)0x0,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((Vector *)&local_70,(Vector *)&local_64,0xff,0xff,0,true,-1.0);
}
if (local_39 == '\0') {
if (*(int *)(g_debug_vehicleexit._28_4_ + 0x30) != 0) {
iVar9 = (**(code **)(*g_pGameRules + 0x7c))(g_pGameRules);
iVar11 = (**(code **)(*g_pGameRules + 0x7c))(g_pGameRules);
NDebugOverlay::Box((Vector *)&local_64,(Vector *)(iVar11 + 0xc),
(Vector *)(iVar9 + 0x18),0,0xff,0,8,20.0);
}
goto LAB_00b38a14;
}
if (*(int *)(g_debug_vehicleexit._28_4_ + 0x30) != 0) {
iVar13 = (**(code **)(*g_pGameRules + 0x7c))(g_pGameRules);
iVar9 = (**(code **)(*g_pGameRules + 0x7c))(g_pGameRules);
NDebugOverlay::Box((Vector *)&local_64,(Vector *)(iVar9 + 0xc),
(Vector *)(iVar13 + 0x18),0xff,0,0,8,20.0);
}
}
else if ((local_3a == '\0') &&
((local_44 != 1.0 ||
(cVar5 = (**(code **)(**(int **)(this + 0x30) + 0x34))
(*(int **)(this + 0x30),this_01,uVar6), cVar5 != '\0'))))
{
LAB_00b38a14:
local_cc = local_130;
local_e8 = local_64;
local_c8 = local_12c;
local_c4 = local_128;
local_bc = local_64 - local_130;
local_94 = 0.0;
local_e4 = local_60;
local_98 = 0.0;
local_b8 = local_60 - local_12c;
local_9c = 0.0;
local_e0 = local_5c;
local_88 = 1;
local_8c = 0;
local_b4 = local_5c - local_128;
local_a4 = 0.0;
local_a8 = 0.0;
local_ac = 0.0;
local_87 = local_b8 * local_b8 + local_bc * local_bc + local_b4 * local_b4 != 0.0;
CTraceFilterSimple::CTraceFilterSimple
(local_dc,(IHandleEntity *)this_00,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((Vector *)&local_70,(Vector *)&local_64,0xff,0,0,true,-1.0);
}
if (local_44 == 1.0) {
local_15c = local_e8;
local_158 = local_e4;
local_154 = local_e0;
local_13e = *(char *)(*(int *)(this + 0x54) + 1 + iVar13);
local_170 = fVar15;
local_160 = iVar14;
}
else if (*(int *)(g_debug_vehicleexit._28_4_ + 0x30) != 0) {
NDebugOverlay::Line((Vector *)&local_130,(Vector *)&local_e8,0xff,0,0,true,10.0);
}
}
else if (*(int *)(g_debug_vehicleexit._28_4_ + 0x30) != 0) {
iVar13 = (**(code **)(*g_pGameRules + 0x7c))(g_pGameRules);
iVar9 = (**(code **)(*g_pGameRules + 0x7c))(g_pGameRules);
NDebugOverlay::Box((Vector *)&local_64,(Vector *)(iVar9 + 0xc),
(Vector *)(iVar13 + 0x18),0xff,0,0,0x40,10.0);
}
LAB_00b38570:
iVar14 = iVar14 + 1;
if (iVar14 == iVar10) goto LAB_00b38c60;
}
iVar14 = iVar14 + 1;
} while (iVar14 != iVar10);
LAB_00b38c60:
uVar6 = g_debug_vehicleexit._28_4_;
if (local_160 != -1) {
*(float *)(this + 0x70) = local_15c;
*(float *)(this + 0x78) = local_154;
*(float *)(this + 0x74) = local_158;
if (*(int *)(uVar6 + 0x30) != 0) {
NDebugOverlay::Cross3D((Vector *)(this + 0x70),16.0,0,0xff,0,true,10.0);
iVar10 = (**(code **)(*g_pGameRules + 0x7c))(g_pGameRules);
iVar14 = (**(code **)(*g_pGameRules + 0x7c))(g_pGameRules);
NDebugOverlay::Box((Vector *)(this + 0x70),(Vector *)(iVar14 + 0xc),
(Vector *)(iVar10 + 0x18),0xff,0xff,0xff,8,10.0);
}
pfVar8 = (float *)(**(code **)(*g_pGameRules + 0x7c))(g_pGameRules);
fVar15 = pfVar8[1];
fVar1 = pfVar8[2];
*(float *)param_1 = local_15c + *pfVar8;
*(float *)(param_1 + 4) = local_158 + fVar15;
*(float *)(param_1 + 8) = local_154 + fVar1;
*(int *)(this + 0x6c) = local_160;
uVar6 = CBaseAnimating::LookupSequence
((CBaseAnimating *)this_00,
(char *)(local_160 * 0x9c + *(int *)(this + 0x54) + 2));
return uVar6;
}
}
*param_2 = true;
}
}
}
return 0xffffffff;
}
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.