CGameMovement::SetGroundEntity
0x00454080 · 813 bytes · __thiscall
_ZN13CGameMovement15SetGroundEntityEP10CGameTrace
Decompiled
undefined (2 params)
/* CGameMovement::SetGroundEntity(CGameTrace*) */
void __thiscall CGameMovement::SetGroundEntity(CGameMovement *this,CGameTrace *param_1)
{
char cVar1;
CBaseEntity *this_00;
CBaseEntity *this_01;
CBaseEntity *this_02;
bool bVar2;
float fVar3;
float fVar4;
float fVar5;
float fVar6;
if (param_1 == (CGameTrace *)0x0) {
bVar2 = true;
this_02 = (CBaseEntity *)0x0;
this_00 = (CBaseEntity *)CBaseEntity::GetGroundEntity(*(CBaseEntity **)(this + 4));
this_01 = *(CBaseEntity **)(this + 4);
fVar5 = *(float *)(this_01 + 0x268);
fVar3 = *(float *)(this_01 + 0x26c);
fVar4 = *(float *)(this_01 + 0x270);
LAB_004541dd:
if ((this_00 != (CBaseEntity *)0x0) && (bVar2)) {
if (((byte)this_00[0x14d] & 0x10) == 0) {
fVar6 = fVar5 + *(float *)(this_00 + 0x274);
fVar3 = fVar3 + *(float *)(this_00 + 0x278);
}
else {
CBaseEntity::CalcAbsoluteVelocity(this_00);
fVar6 = fVar5 + *(float *)(this_00 + 0x274);
fVar3 = fVar3 + *(float *)(this_00 + 0x278);
if (((byte)this_00[0x14d] & 0x10) == 0) {
this_01 = *(CBaseEntity **)(this + 4);
}
else {
CBaseEntity::CalcAbsoluteVelocity(this_00);
this_01 = *(CBaseEntity **)(this + 4);
}
}
fVar4 = *(float *)(this_00 + 0x27c);
fVar5 = *(float *)(this_01 + 0x268);
goto LAB_004540fd;
}
LAB_004541ea:
if ((fVar3 != *(float *)(this_01 + 0x26c)) || (fVar4 != *(float *)(this_01 + 0x270)))
goto LAB_00454106;
CBaseEntity::SetGroundEntity(this_01,this_02);
if (this_02 != (CBaseEntity *)0x0) goto LAB_00454168;
LAB_00454218:
*(undefined4 *)(this + 0x7d4) = 0;
*(undefined4 *)(this + 0x7d8) = 0;
*(undefined4 *)(this + 0x7dc) = 0x3f800000;
}
else {
this_02 = *(CBaseEntity **)(param_1 + 0x4c);
this_00 = (CBaseEntity *)CBaseEntity::GetGroundEntity(*(CBaseEntity **)(this + 4));
this_01 = *(CBaseEntity **)(this + 4);
fVar5 = *(float *)(this_01 + 0x268);
fVar3 = *(float *)(this_01 + 0x26c);
fVar4 = *(float *)(this_01 + 0x270);
if ((this_00 != (CBaseEntity *)0x0) || (this_02 == (CBaseEntity *)0x0)) {
bVar2 = this_02 == (CBaseEntity *)0x0;
goto LAB_004541dd;
}
if (((byte)this_02[0x14d] & 0x10) == 0) {
fVar3 = fVar3 - *(float *)(this_02 + 0x278);
fVar6 = fVar5 - *(float *)(this_02 + 0x274);
}
else {
CBaseEntity::CalcAbsoluteVelocity(this_02);
fVar6 = fVar5 - *(float *)(this_02 + 0x274);
fVar3 = fVar3 - *(float *)(this_02 + 0x278);
if (((byte)this_02[0x14d] & 0x10) == 0) {
this_01 = *(CBaseEntity **)(this + 4);
fVar5 = *(float *)(this_01 + 0x268);
}
else {
CBaseEntity::CalcAbsoluteVelocity(this_02);
this_01 = *(CBaseEntity **)(this + 4);
fVar5 = *(float *)(this_01 + 0x268);
}
}
fVar4 = *(float *)(this_02 + 0x27c);
LAB_004540fd:
bVar2 = fVar5 == fVar6;
fVar5 = fVar6;
if (bVar2) goto LAB_004541ea;
LAB_00454106:
(**(code **)(*(int *)this_01 + 0x2fc))(this_01,this_01 + 0x268);
*(float *)(this_01 + 0x268) = fVar5;
*(float *)(this_01 + 0x26c) = fVar3;
*(float *)(this_01 + 0x270) = fVar4;
CBaseEntity::SetGroundEntity(*(CBaseEntity **)(this + 4),this_02);
if (this_02 == (CBaseEntity *)0x0) goto LAB_00454218;
LAB_00454168:
(**(code **)(*(int *)this + 0xf4))(this,param_1);
*(undefined4 *)(*(int *)(this + 4) + 0x2010) = 0;
cVar1 = CGameTrace::DidHitWorld(param_1);
if (cVar1 == '\0') {
(**(code **)(*IMoveHelper::sm_pSingleton + 0xc))
(IMoveHelper::sm_pSingleton,param_1,*(int *)(this + 8) + 0x40);
}
(**(code **)(*IMoveHelper::sm_pSingleton + 0x10))(IMoveHelper::sm_pSingleton,param_1 + 0x18);
cVar1 = (**(code **)(*(int *)this_02 + 0x180))(this_02);
param_1 = (CGameTrace *)this_02;
if (cVar1 != '\0') goto LAB_004541c0;
}
param_1 = (CGameTrace *)0x0;
LAB_004541c0:
CBasePlayer::NotifyFromElevator(*(CBasePlayer **)(this + 4),(CFuncElevator *)param_1);
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.