CBaseEntity::VPhysicsUpdatePusher
0x00614190 · 3715 bytes · __thiscall
_ZN11CBaseEntity20VPhysicsUpdatePusherEP14IPhysicsObject
Decompiled
undefined (2 params)
/* CBaseEntity::VPhysicsUpdatePusher(IPhysicsObject*) */
void __thiscall CBaseEntity::VPhysicsUpdatePusher(CBaseEntity *this,IPhysicsObject *param_1)
{
CBaseEntity *pCVar1;
bool bVar2;
bool bVar3;
bool bVar4;
float fVar5;
float fVar6;
float fVar7;
float fVar8;
char cVar9;
int iVar10;
int iVar11;
int *piVar12;
int *piVar13;
int *piVar14;
undefined *puVar15;
float *pfVar16;
longdouble lVar17;
float fVar18;
float fVar19;
float fVar20;
float fVar21;
int local_170;
float local_16c;
float local_168;
int local_164;
float local_160;
float *local_158;
int local_150;
float local_14c;
float local_148;
float local_144;
undefined1 local_140 [12];
undefined1 local_134 [12];
float local_128;
float local_124;
float local_120;
QAngle local_11c [12];
float 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;
Vector local_e0 [12];
QAngle local_d4 [12];
float local_c8;
float local_c4;
float local_c0;
int *local_bc [3];
float local_b0;
float local_ac;
float local_a8;
int local_a4 [5];
float *local_90;
CBaseEntity *local_8c;
CBaseEntity *local_88;
float local_84;
float local_80;
float local_7c;
float local_78;
float local_74;
float local_70;
float local_60;
float local_50;
float local_4c;
float local_48;
float local_44;
fVar20 = *(float *)(this + 0x2d0) - *(float *)(this + 0x2d4);
if (fVar20 <= 0.0) {
return;
}
cVar9 = PhysIsFinalTick();
if (cVar9 == '\0') {
return;
}
iVar10 = (**(code **)(*(int *)(this + 0x194) + 0x2c))(this + 0x194);
if (((iVar10 == 1) || (iVar10 = (**(code **)(*(int *)param_1 + 0x15c))(param_1), iVar10 != 0)) ||
(iVar10 = (**(code **)(*(int *)param_1 + 0x11c))(param_1,local_140,local_134), iVar10 == 0))
goto LAB_00614204;
local_a4[0] = 0;
local_a4[1] = 0;
local_a4[2] = 0;
local_a4[3] = 0;
local_a4[4] = 0;
/* try { // try from 006142de to 0061502e has its CatchHandler @ 00615050 */
GetAllInHierarchy(this,(CUtlVector *)local_a4);
cVar9 = HasDataObjectType(this,5);
local_158 = (float *)0x0;
if (cVar9 != '\0') {
local_158 = (float *)GetDataObject(this,5);
}
bVar2 = true;
if ((vec3_angle == *(float *)(this + 0x280)) &&
(bVar2 = true, DAT_01053d40 == *(float *)(this + 0x284))) {
bVar2 = DAT_01053d44 != *(float *)(this + 0x288);
}
bVar3 = true;
if ((vec3_origin == *(float *)(this + 0x2ec)) &&
(bVar3 = true, DAT_01053d4c == *(float *)(this + 0x2f0))) {
bVar3 = DAT_01053d50 != *(float *)(this + 0x2f4);
}
local_8c = this;
local_84 = 0.0;
local_88 = (CBaseEntity *)0x0;
local_90 = local_158;
local_80 = fVar20;
if (0 < local_a4[3]) {
iVar10 = 0;
do {
pCVar1 = *(CBaseEntity **)(local_a4[0] + iVar10 * 4);
if ((((pCVar1[0x1b6] != (CBaseEntity)0x0) && ((*(ushort *)(pCVar1 + 0x1b4) & 4) == 0)) &&
(piVar13 = *(int **)(pCVar1 + 0x238), piVar13 != (int *)0x0)) &&
((cVar9 = (**(code **)(*piVar13 + 0x2c))(piVar13), cVar9 != '\0' &&
(iVar11 = (**(code **)(*piVar13 + 0x120))(piVar13), iVar11 != 0)))) {
(**(code **)(*piVar13 + 0x11c))(piVar13,&local_128,local_11c);
bVar4 = true;
if (pCVar1 == local_8c) {
if ((vec3_angle == *(float *)(pCVar1 + 0x280)) &&
(DAT_01053d40 == *(float *)(pCVar1 + 0x284))) {
bVar4 = DAT_01053d44 != *(float *)(pCVar1 + 0x288);
}
if (((vec3_origin != *(float *)(pCVar1 + 0x2ec)) ||
(DAT_01053d4c != *(float *)(pCVar1 + 0x2f0))) ||
(DAT_01053d50 != *(float *)(pCVar1 + 0x2f4))) goto LAB_00614473;
LAB_006145ec:
local_160 = -1.0;
}
else {
LAB_00614473:
if (((byte)pCVar1[0x14d] & 0x10) != 0) {
CalcAbsoluteVelocity(pCVar1);
}
local_110 = *(float *)(pCVar1 + 0x274);
local_10c = *(float *)(pCVar1 + 0x278);
local_108 = *(float *)(pCVar1 + 0x27c);
lVar17 = (longdouble)VectorNormalize((Vector *)&local_110);
piVar12 = (int *)(**(code **)(*piVar13 + 0x120))(piVar13);
(**(code **)(*piVar12 + 0x34))(piVar12,&local_104,0);
fVar8 = local_108;
fVar7 = local_10c;
fVar6 = local_110;
fVar5 = local_120;
fVar19 = local_124;
fVar21 = local_128;
fVar18 = local_fc * local_108 + local_104 * local_110 + local_10c * local_100;
if (((byte)pCVar1[0x14d] & 8) != 0) {
CalcAbsolutePosition(pCVar1);
}
if (1.0 < (fVar18 - (local_108 * *(float *)(pCVar1 + 0x2e8) +
local_10c * *(float *)(pCVar1 + 0x2e4))) -
local_110 * *(float *)(pCVar1 + 0x2e0)) {
(**(code **)(*(int *)pCVar1 + 0x2b4))(pCVar1,0);
goto LAB_006145ec;
}
fVar21 = fVar18 - (fVar21 * fVar6 + fVar5 * fVar8 + fVar19 * fVar7);
if (fVar21 <= 1.0) goto LAB_006145ec;
if (pCVar1 == local_8c) {
if (local_90 == (float *)0x0) {
fVar19 = fVar18 - local_80 * (float)lVar17;
}
else {
local_f8 = *(float *)(pCVar1 + 0x2ec);
local_f4 = *(float *)(pCVar1 + 0x2f0);
local_f0 = *(float *)(pCVar1 + 0x2f4);
VectorNormalize((Vector *)&local_f8);
fVar19 = ((((local_90[2] * local_f4 + local_90[1] * local_f8 + local_90[3] * local_f0)
- local_f4 * *(float *)(pCVar1 + 0x3a0)) -
local_f8 * *(float *)(pCVar1 + 0x39c)) -
local_f0 * *(float *)(pCVar1 + 0x3a4)) + fVar18;
}
}
else {
ComputePushStartMatrix((matrix3x4_t *)&local_7c,pCVar1,(pushblock_t *)&local_90);
fVar19 = local_10c * local_60 + local_110 * local_70 + local_108 * local_50;
}
local_160 = 1.0;
if (0.0 < fVar18 - fVar19) {
local_160 = fVar21 / (fVar18 - fVar19);
if (local_160 <= 0.0) {
local_160 = 0.0;
}
if (1.0 <= local_160) {
local_160 = 1.0;
}
}
}
fVar21 = local_160;
if (bVar4) {
if (((byte)pCVar1[0x14d] & 8) != 0) {
CalcAbsolutePosition(pCVar1);
}
RotationDeltaAxisAngle
(local_11c,(QAngle *)(pCVar1 + 0x37c),(Vector *)&local_ec,&local_14c);
if (0.5 < ABS(local_14c)) {
piVar13 = (int *)(**(code **)(*piVar13 + 0x120))(piVar13);
(**(code **)(*piVar13 + 0x34))(piVar13,0,local_d4);
RotationDeltaAxisAngle(local_11c,local_d4,local_e0,&local_148);
if (ABS(local_148) <= 0.01) {
(**(code **)(*(int *)pCVar1 + 0x2b4))(pCVar1,0);
}
else {
if (pCVar1 == local_8c) {
fVar19 = SQRT(*(float *)(pCVar1 + 0x284) * *(float *)(pCVar1 + 0x284) +
*(float *)(pCVar1 + 0x288) * *(float *)(pCVar1 + 0x288) +
*(float *)(pCVar1 + 0x280) * *(float *)(pCVar1 + 0x280)) * local_80;
}
else {
ComputePushStartMatrix((matrix3x4_t *)&local_4c,pCVar1,(pushblock_t *)&local_90);
MatrixAngles((matrix3x4_t *)&local_4c,(float *)local_bc);
if (((byte)pCVar1[0x14d] & 8) != 0) {
CalcAbsolutePosition(pCVar1);
}
RotationDeltaAxisAngle
((QAngle *)local_bc,(QAngle *)(pCVar1 + 0x37c),(Vector *)&local_c8,
&local_144);
fVar19 = (local_e8 * local_c4 + local_ec * local_c8 + local_e4 * local_c0) *
local_144;
}
fVar21 = 1.0;
if (fVar19 != 0.0) {
fVar21 = ABS(local_14c / fVar19);
if (fVar21 <= 0.0) {
fVar21 = 0.0;
}
if (1.0 <= fVar21) {
fVar21 = 1.0;
}
}
if (fVar21 <= local_160) {
fVar21 = local_160;
}
}
}
}
local_160 = fVar21;
if (local_84 <= local_160) {
local_88 = pCVar1;
local_84 = local_160;
}
}
iVar10 = iVar10 + 1;
} while (iVar10 < local_a4[3]);
if (((local_88 != (CBaseEntity *)0x0) && (fVar21 = local_84 * fVar20, 0.0 < fVar21)) &&
(local_16c = *(float *)(this + 0x2d0) - fVar21,
local_16c <= fVar20 * 0.99 + *(float *)(this + 0x2d4))) {
cVar9 = (**(code **)(**(int **)(local_88 + 0x238) + 0x110))
(*(int **)(local_88 + 0x238),0,local_bc);
local_170 = 0;
if (cVar9 != '\0') {
local_170 = (**(code **)(*local_bc[0] + 0x48))(local_bc[0]);
}
if (local_158 == (float *)0x0) {
local_7c = *(float *)(this + 0x39c);
local_78 = *(float *)(this + 0x3a0);
local_74 = *(float *)(this + 0x3a4);
local_4c = *(float *)(this + 0x3a8);
local_48 = *(float *)(this + 0x3ac);
local_44 = *(float *)(this + 0x3b0);
if (bVar3) {
local_7c = local_7c - *(float *)(this + 0x2ec) * fVar21;
local_78 = local_78 - *(float *)(this + 0x2f0) * fVar21;
local_74 = local_74 - *(float *)(this + 0x2f4) * fVar21;
}
if (bVar2) {
local_4c = local_4c - *(float *)(this + 0x280) * fVar21;
local_48 = local_48 - *(float *)(this + 0x284) * fVar21;
local_44 = local_44 - *(float *)(this + 0x288) * fVar21;
}
SetLocalOrigin(this,(Vector *)&local_7c);
SetLocalAngles(this,(QAngle *)&local_4c);
LAB_00614ed9:
if (local_170 != 0) {
local_164 = local_170;
goto LAB_006146ad;
}
}
else {
SetLocalOrigin(this,(Vector *)(local_158 + 1));
SetLocalAngles(this,(QAngle *)(local_158 + 4));
local_150 = 0;
local_16c = *local_158;
pfVar16 = local_158;
if (0 < (int)local_158[7]) {
do {
fVar20 = local_158[local_150 + 8];
if (((fVar20 != -NAN) &&
(puVar15 = g_pEntityList + ((uint)fVar20 & 0xfff) * 0x10,
puVar15 != (undefined *)0xfffffffc)) &&
((*(uint *)(puVar15 + 8) == (uint)fVar20 >> 0xc &&
(pCVar1 = *(CBaseEntity **)(puVar15 + 4), pCVar1 != (CBaseEntity *)0x0)))) {
if (((byte)pCVar1[0x14d] & 8) != 0) {
CalcAbsolutePosition(pCVar1);
}
local_4c = *(float *)(pCVar1 + 0x2e0) - pfVar16[0x28];
local_48 = *(float *)(pCVar1 + 0x2e4) - pfVar16[0x29];
local_44 = *(float *)(pCVar1 + 0x2e8) - pfVar16[0x2a];
SetAbsOrigin(pCVar1,(Vector *)&local_4c);
}
local_150 = local_150 + 1;
pfVar16 = pfVar16 + 3;
} while (local_150 < (int)local_158[7]);
}
piVar13 = *(int **)(this + 0x238);
piVar12 = (int *)(**(code **)(*piVar13 + 0x144))(piVar13);
local_168 = 0.0;
local_164 = 0;
while (cVar9 = (**(code **)(*piVar12 + 8))(piVar12), cVar9 != '\0') {
piVar14 = (int *)(**(code **)(*piVar12 + 0xc))(piVar12,1);
iVar10 = (**(code **)(*piVar14 + 0x48))(piVar14);
if (0 < (int)local_158[7]) {
fVar20 = 0.0;
do {
fVar21 = local_158[(int)fVar20 + 8];
iVar11 = 0;
if (((fVar21 != -NAN) &&
(puVar15 = g_pEntityList + ((uint)fVar21 & 0xfff) * 0x10,
puVar15 != (undefined *)0xfffffffc)) &&
(*(uint *)(puVar15 + 8) == (uint)fVar21 >> 0xc)) {
iVar11 = *(int *)(puVar15 + 4);
}
if (iVar10 == iVar11) {
bVar2 = true;
goto LAB_00614cf5;
}
fVar20 = (float)((int)fVar20 + 1);
} while (fVar20 != local_158[7]);
}
bVar2 = false;
LAB_00614cf5:
(**(code **)(*piVar12 + 0x18))(piVar12,&local_b0);
lVar17 = (longdouble)(**(code **)(*piVar12 + 0x1c))(piVar12);
fVar20 = (float)lVar17 *
(local_158[0x29] * local_ac + local_158[0x28] * local_b0 +
local_158[0x2a] * local_a8);
iVar11 = iVar10;
if (((local_164 == 0) || (iVar11 = local_164, local_168 < fVar20)) &&
(local_164 = iVar11, !bVar2)) {
local_168 = fVar20;
local_164 = iVar10;
}
(**(code **)(*piVar12 + 0x34))(piVar12);
}
(**(code **)(*piVar13 + 0x148))(piVar13,piVar12);
if (local_164 == 0) goto LAB_00614ed9;
LAB_006146ad:
(**(code **)(*(int *)this + 0x1c0))(this,local_164);
}
*(float *)(this + 0x2d0) = local_16c;
}
}
local_a4[3] = 0;
CUtlMemory<CBaseEntity*,int>::Purge((CUtlMemory<CBaseEntity*,int> *)local_a4);
local_a4[4] = local_a4[0];
CUtlMemory<CBaseEntity*,int>::Purge((CUtlMemory<CBaseEntity*,int> *)local_a4);
LAB_00614204:
cVar9 = HasDataObjectType(this,5);
if (cVar9 != '\0') {
DestroyDataObject(this,5);
}
*(float *)(this + 0x2d4) = *(float *)(this + 0x2d0);
if ((*(float *)(this + 0x2d8) <= *(float *)(this + 0x2d0)) && (0.0 < *(float *)(this + 0x2d8))) {
*(undefined4 *)(this + 0x2d8) = 0xbf800000;
CheckHasGamePhysicsSimulation(this);
(**(code **)(*(int *)this + 0xe0))(this);
}
return;
}
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.