CBaseEntity::ResolveFlyCollisionBounce
0x00477530 · 915 bytes · __thiscall
_ZN11CBaseEntity25ResolveFlyCollisionBounceER10CGameTraceR6Vectorf
Decompiled
undefined (4 params)
/* CBaseEntity::ResolveFlyCollisionBounce(CGameTrace&, Vector&, float) */
void __thiscall
CBaseEntity::ResolveFlyCollisionBounce
(CBaseEntity *this,CGameTrace *param_1,Vector *param_2,float param_3)
{
CBaseEntity *this_00;
char cVar1;
float fVar2;
float fVar3;
float fVar4;
float fVar5;
float fVar6;
float local_38;
float local_34;
float local_30;
float local_2c;
float local_28;
float local_24;
float local_20;
(**(code **)(*physprops + 0x14))(physprops,(int)*(short *)(param_1 + 0x40),0,0,0,&local_38);
local_38 = *(float *)(this + 0x2c8) * local_38;
fVar2 = 0.9;
if (local_38 <= 0.9) {
if (param_3 <= 0.9) {
fVar2 = param_3;
}
if (fVar2 <= local_38) {
fVar2 = local_38;
}
}
if (((byte)this[0x14d] & 0x10) != 0) {
CalcAbsoluteVelocity(this);
}
PhysicsClipVelocity(this,(Vector *)(this + 0x274),(Vector *)(param_1 + 0x18),(Vector *)&local_34,
2.0);
local_34 = local_34 * fVar2;
local_30 = local_30 * fVar2;
local_2c = fVar2 * local_2c;
fVar5 = *(float *)(this + 0x268) + local_34;
*(float *)param_2 = fVar5;
fVar2 = *(float *)(this + 0x26c) + local_30;
*(float *)(param_2 + 4) = fVar2;
fVar3 = local_2c + *(float *)(this + 0x270);
*(float *)(param_2 + 8) = fVar3;
fVar2 = fVar2 * fVar2 + fVar5 * fVar5 + fVar3 * fVar3;
if (*(float *)(param_1 + 0x20) <= 0.7) {
if (900.0 <= fVar2) {
SetAbsVelocity(this,(Vector *)&local_34);
return;
}
}
else {
fVar5 = *(float *)(this + 0x2c0);
this_00 = *(CBaseEntity **)(param_1 + 0x4c);
if (fVar5 == 0.0) {
fVar5 = 1.0;
}
if (fVar3 < *(float *)(sv_gravity._28_4_ + 0x2c) * *(float *)(gpGlobals + 0x10) * fVar5) {
fVar5 = local_34 + *(float *)(this + 0x268);
local_2c = 0.0;
*(float *)param_2 = fVar5;
fVar3 = local_30 + *(float *)(this + 0x26c);
*(float *)(param_2 + 4) = fVar3;
fVar2 = *(float *)(this + 0x270);
*(float *)(param_2 + 8) = fVar2;
fVar2 = fVar5 * fVar5 + fVar3 * fVar3 + fVar2 * fVar2;
}
SetAbsVelocity(this,(Vector *)&local_34);
if (900.0 <= fVar2) {
local_28 = *(float *)(this + 0x268);
local_24 = *(float *)(this + 0x26c);
fVar5 = *(float *)(this + 0x268) - local_34;
fVar3 = *(float *)(this + 0x26c) - local_30;
fVar2 = *(float *)(this + 0x270) - local_2c;
local_20 = *(float *)(this + 0x270);
VectorNormalize((Vector *)&local_28);
fVar4 = fVar3 * local_24 + fVar5 * local_28 + fVar2 * local_20;
fVar5 = (1.0 - *(float *)(param_1 + 0x2c)) * *(float *)(gpGlobals + 0x10);
*(float *)param_2 = local_34 * fVar5;
*(float *)(param_2 + 4) = local_30 * fVar5;
*(float *)(param_2 + 8) = local_2c * fVar5;
fVar2 = *(float *)(this + 0x26c);
fVar3 = *(float *)(this + 0x270);
fVar6 = (1.0 - *(float *)(param_1 + 0x2c)) * *(float *)(gpGlobals + 0x10);
*(float *)param_2 = *(float *)(this + 0x268) * fVar6 * fVar4 + local_34 * fVar5;
*(float *)(param_2 + 4) = fVar2 * fVar6 * fVar4 + local_30 * fVar5;
*(float *)(param_2 + 8) = fVar3 * fVar6 * fVar4 + local_2c * fVar5;
PhysicsPushEntity(this,param_2,param_1);
return;
}
cVar1 = IsStandable(this_00);
if (cVar1 != '\0') {
SetGroundEntity(this,this_00);
}
}
SetAbsVelocity(this,(Vector *)&vec3_origin);
SetLocalAngularVelocity(this,(QAngle *)&vec3_angle);
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.