PerformObstaclePushaway
0x00471640 · 561 bytes · __cdecl
_Z23PerformObstaclePushawayP20CBaseCombatCharacter
Decompiled
undefined (1 param)
/* PerformObstaclePushaway(CBaseCombatCharacter*) */
void PerformObstaclePushaway(CBaseCombatCharacter *param_1)
{
int *piVar1;
code *pcVar2;
int iVar3;
float *pfVar4;
float *pfVar5;
undefined4 uVar6;
undefined4 *puVar7;
int iVar8;
int iVar9;
CBaseEntity *pCVar10;
longdouble lVar11;
float fVar12;
float local_434;
float local_430;
float local_42c;
float local_428;
float local_424;
float local_420;
CBaseEntity *local_41c [259];
if ((param_1[0x104] == (CBaseCombatCharacter)0x0) &&
(iVar3 = GetPushawayEnts(param_1,local_41c,0x100,3.0,1,(CPushAwayEnumerator *)0x0), 0 < iVar3))
{
iVar9 = 0;
do {
pCVar10 = local_41c[iVar9];
if ((pCVar10 == (CBaseEntity *)0x0) ||
(puVar7 = (undefined4 *)
__dynamic_cast(pCVar10,&CBaseEntity::typeinfo,&IMultiplayerPhysics::typeinfo,
0xfffffffe), puVar7 == (undefined4 *)0x0)) {
LAB_004716b7:
piVar1 = *(int **)(pCVar10 + 0x238);
if (piVar1 != (int *)0x0) {
pfVar4 = (float *)(**(code **)(*(int *)param_1 + 0x288))(param_1);
pfVar5 = (float *)(**(code **)(*(int *)local_41c[iVar9] + 0x288))(local_41c[iVar9]);
local_434 = *pfVar5 - *pfVar4;
local_430 = pfVar5[1] - pfVar4[1];
local_42c = 0.0;
lVar11 = (longdouble)VectorNormalize((Vector *)&local_434);
fVar12 = (float)lVar11;
if (fVar12 <= 1.0) {
fVar12 = 1.0;
}
fVar12 = *(float *)(sv_pushaway_force._28_4_ + 0x2c) / fVar12;
if (*(float *)(sv_pushaway_max_force._28_4_ + 0x2c) <= fVar12) {
fVar12 = *(float *)(sv_pushaway_max_force._28_4_ + 0x2c);
}
pcVar2 = *(code **)(*piVar1 + 0xf8);
uVar6 = (**(code **)(*(int *)param_1 + 0x288))(param_1);
local_428 = local_434 * fVar12;
local_424 = local_430 * fVar12;
local_420 = fVar12 * local_42c;
(*pcVar2)(piVar1,&local_428,uVar6);
}
}
else {
iVar8 = (**(code **)*puVar7)(puVar7);
if (iVar8 != 1) {
LAB_004716b0:
pCVar10 = local_41c[iVar9];
goto LAB_004716b7;
}
if (((byte)param_1[0x14d] & 0x10) != 0) {
CBaseEntity::CalcAbsoluteVelocity((CBaseEntity *)param_1);
}
if (*(float *)(sv_pushaway_min_player_speed._28_4_ + 0x2c) <=
SQRT(*(float *)(param_1 + 0x278) * *(float *)(param_1 + 0x278) +
*(float *)(param_1 + 0x274) * *(float *)(param_1 + 0x274))) goto LAB_004716b0;
}
iVar9 = iVar9 + 1;
} while (iVar9 != iVar3);
}
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.