CGameMovement::ElevatorPushPlayer
0x0045d500 · 2321 bytes · __thiscall
_ZN13CGameMovement18ElevatorPushPlayerEP13CFuncElevator
Decompiled
undefined (2 params)
/* CGameMovement::ElevatorPushPlayer(CFuncElevator*) */
void __thiscall CGameMovement::ElevatorPushPlayer(CGameMovement *this,CFuncElevator *param_1)
{
undefined4 uVar1;
code *pcVar2;
CBaseEntity *this_00;
uint uVar3;
int *piVar4;
char cVar5;
char cVar6;
CFuncElevator *pCVar7;
undefined4 uVar8;
float *pfVar9;
int iVar10;
IHandleEntity *pIVar11;
float *pfVar12;
undefined *puVar13;
longdouble lVar14;
float fVar15;
float local_114;
undefined4 local_110;
undefined4 local_10c;
float local_108;
undefined4 local_104;
undefined4 local_100;
float local_fc;
undefined4 local_f8;
undefined4 local_f4;
float local_f0;
undefined4 local_ec;
undefined4 local_e8;
float local_e4;
undefined **local_e0;
float local_dc;
float local_d8;
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;
undefined1 local_70 [12];
undefined4 local_64;
undefined4 local_60;
undefined4 local_5c;
float local_44;
char local_3a;
char local_39;
CBaseEntity *local_24;
if (param_1 == (CFuncElevator *)0x0) {
return;
}
iVar10 = *(int *)(this + 4);
if ((*(byte *)(iVar10 + 0x186) < 0xb) && ((1 << (*(byte *)(iVar10 + 0x186) & 0x1f) & 0x503U) != 0)
) {
return;
}
if (((byte)param_1[0x14d] & 8) != 0) {
CBaseEntity::CalcAbsolutePosition((CBaseEntity *)param_1);
iVar10 = *(int *)(this + 4);
}
local_110 = *(undefined4 *)(param_1 + 0x2e0);
local_10c = *(undefined4 *)(param_1 + 0x2e4);
local_108 = *(float *)(param_1 + 0x2e8);
lVar14 = (longdouble)
CFuncElevator::GetHeightForTime
(param_1,"ElevatorPushPlayer1",
(float)*(int *)(iVar10 + 0x2058) * *(float *)(gpGlobals + 0x1c),&local_114);
local_108 = (float)lVar14;
local_104 = local_110;
local_100 = local_10c;
local_fc = local_108;
lVar14 = (longdouble)
CFuncElevator::GetHeightForTime
(param_1,"ElevatorPushPlayer2",*(float *)(gpGlobals + 0xc),&local_114);
local_fc = (float)lVar14;
fVar15 = local_fc - local_108;
if (fVar15 == 0.0) {
return;
}
pCVar7 = (CFuncElevator *)CBasePlayer::GetElevator(*(CBasePlayer **)(this + 4));
if (param_1 != pCVar7) {
iVar10 = *(int *)(this + 8);
local_f8 = *(undefined4 *)(iVar10 + 0x9c);
local_f4 = *(undefined4 *)(iVar10 + 0xa0);
local_f0 = *(float *)(iVar10 + 0xa4);
local_e4 = fVar15 + local_f0;
pcVar2 = *(code **)(*(int *)this + 0x3c);
local_ec = local_f8;
local_e8 = local_f4;
uVar8 = (**(code **)(*(int *)this + 0x40))(this,0,0);
(*pcVar2)(this,&local_f8,&local_ec,uVar8,8,local_70);
if (local_44 == 1.0) {
return;
}
pfVar9 = (float *)(**(code **)(*(int *)this + 0x7c))(this);
iVar10 = *(int *)(this + 8);
local_e0 = (undefined **)(*pfVar9 + *(float *)(iVar10 + 0x9c));
local_dc = pfVar9[1] + *(float *)(iVar10 + 0xa0);
local_d8 = pfVar9[2] + *(float *)(iVar10 + 0xa4);
pfVar9 = (float *)(**(code **)(*(int *)this + 0x80))(this);
iVar10 = *(int *)(this + 8);
local_cc = *pfVar9 + *(float *)(iVar10 + 0x9c);
local_c8 = pfVar9[1] + *(float *)(iVar10 + 0xa0);
local_c4 = pfVar9[2] + *(float *)(iVar10 + 0xa4);
CBaseEntity::SetAbsOrigin((CBaseEntity *)param_1,(Vector *)&local_110);
cVar5 = IsElevatorInteresting_R((CBaseEntity *)param_1,(Vector *)&local_e0,(Vector *)&local_cc);
CBaseEntity::SetAbsOrigin((CBaseEntity *)param_1,(Vector *)&local_104);
cVar6 = IsElevatorInteresting_R((CBaseEntity *)param_1,(Vector *)&local_e0,(Vector *)&local_cc);
if ((cVar6 != '\x01') && (cVar5 != '\x01')) {
return;
}
if (cVar5 != '\0') {
uVar8 = local_ec;
local_ec = local_f8;
uVar1 = local_e8;
local_e8 = local_f4;
fVar15 = local_f0;
local_f0 = local_e4;
local_f8 = uVar8;
local_f4 = uVar1;
local_e4 = fVar15;
}
pcVar2 = *(code **)(*(int *)this + 0x3c);
uVar8 = (**(code **)(*(int *)this + 0x40))(this,0,0);
(*pcVar2)(this,&local_f8,&local_ec,uVar8,8,local_70);
if (((local_39 != '\0') && (local_24 != (CBaseEntity *)0x0)) &&
(pCVar7 = (CFuncElevator *)CBaseEntity::GetRootMoveParent(local_24), param_1 == pCVar7)) {
return;
}
iVar10 = *(int *)(this + 8);
*(undefined4 *)(iVar10 + 0x9c) = local_64;
*(undefined4 *)(iVar10 + 0xa0) = local_60;
*(undefined4 *)(iVar10 + 0xa4) = local_5c;
(**(code **)(*(int *)this + 0xcc))(this,0);
return;
}
this_00 = *(CBaseEntity **)(this + 4);
if (((this_00 != (CBaseEntity *)0x0) &&
(cVar5 = (**(code **)(*(int *)this_00 + 0x16c))(this_00), cVar5 != '\0')) &&
(cVar5 = (**(code **)(*(int *)this_00 + 0x558))(this_00), cVar5 == '\0')) {
iVar10 = CBaseEntity::GetTeamNumber(this_00);
cVar5 = IsASurvivorTeam(iVar10);
if (((cVar5 != '\0') &&
((((((uVar3 = *(uint *)(this_00 + 0x3e68), uVar3 != 0xffffffff &&
(puVar13 = g_pEntityList + (uVar3 & 0xfff) * 0x10, puVar13 != (undefined *)0xfffffffc))
&& ((*(uint *)(puVar13 + 8) == uVar3 >> 0xc && (*(int *)(puVar13 + 4) != 0)))) ||
((((uVar3 = *(uint *)(this_00 + 0x3e48), uVar3 != 0xffffffff &&
(puVar13 = g_pEntityList + (uVar3 & 0xfff) * 0x10, puVar13 != (undefined *)0xfffffffc)
) && (*(uint *)(puVar13 + 8) == uVar3 >> 0xc)) && (*(int *)(puVar13 + 4) != 0)))) ||
(((uVar3 = *(uint *)(this_00 + 0x33c4), uVar3 != 0xffffffff &&
(puVar13 = g_pEntityList + (uVar3 & 0xfff) * 0x10, puVar13 != (undefined *)0xfffffffc))
&& ((*(uint *)(puVar13 + 8) == uVar3 >> 0xc &&
((*(int *)(puVar13 + 4) != 0 && (this_00[0x39f1] == (CBaseEntity)0x0)))))))) ||
(cVar5 = (**(code **)(*(int *)this_00 + 0x7e8))(this_00), cVar5 == '\0')))) &&
(cVar5 = CTerrorPlayer::IsDominatedBySpecialInfected((CTerrorPlayer *)this_00), cVar5 == '\0'
)) {
uVar3 = *(uint *)(*(IHandleEntity **)(this + 4) + 0x2338);
if (((uVar3 == 0xffffffff) ||
(puVar13 = g_pEntityList + (uVar3 & 0xfff) * 0x10, puVar13 == (undefined *)0xfffffffc)) ||
(*(uint *)(puVar13 + 8) != uVar3 >> 0xc)) {
pIVar11 = (IHandleEntity *)0x0;
}
else {
pIVar11 = *(IHandleEntity **)(puVar13 + 4);
}
CTraceFilterSkipTwoEntities::CTraceFilterSkipTwoEntities
((CTraceFilterSkipTwoEntities *)&local_e0,*(IHandleEntity **)(this + 4),pIVar11,8);
local_e0 = &PTR_ShouldHitEntity_00c13d68;
uVar8 = (**(code **)(*(int *)this + 0x40))(this,0,0);
pfVar9 = (float *)(**(code **)(*(int *)this + 0x80))(this);
pfVar12 = (float *)(**(code **)(*(int *)this + 0x7c))(this);
iVar10 = *(int *)(this + 8);
local_cc = *(float *)(iVar10 + 0x9c);
local_c8 = *(float *)(iVar10 + 0xa0);
fVar15 = fVar15 + *(float *)(iVar10 + 0xa4);
*(int *)(this + 2000) = *(int *)(this + 2000) + 1;
local_bc = *(float *)(iVar10 + 0x9c) - local_cc;
local_b8 = *(float *)(iVar10 + 0xa0) - local_c8;
local_8c = 0;
local_b4 = *(float *)(iVar10 + 0xa4) - fVar15;
local_87 = local_b8 * local_b8 + local_bc * local_bc + local_b4 * local_b4 != 0.0;
local_9c = (*pfVar9 - *pfVar12) * 0.5;
local_98 = (pfVar9[1] - pfVar12[1]) * 0.5;
local_94 = (pfVar9[2] - pfVar12[2]) * 0.5;
local_88 = local_98 * local_98 + local_9c * local_9c + local_94 * local_94 < 1e-06;
local_ac = (*pfVar9 + *pfVar12) * 0.5;
local_cc = local_cc + local_ac;
local_a8 = (pfVar9[1] + pfVar12[1]) * 0.5;
piVar4 = *(int **)(this + 0x7cc);
local_a4 = (pfVar9[2] + pfVar12[2]) * 0.5;
local_c8 = local_c8 + local_a8;
local_c4 = fVar15 + local_a4;
local_ac = -local_ac;
local_a8 = -local_a8;
local_a4 = -local_a4;
if (piVar4 != (int *)0x0) {
cVar5 = (**(code **)(*piVar4 + 0x10))(piVar4,&local_cc);
if (cVar5 != '\0') {
(**(code **)(*enginetrace + 0x20))
(enginetrace,&local_cc,*(undefined4 *)(this + 0x7cc),uVar8,
(CTraceFilterSkipTwoEntities *)&local_e0,local_70);
goto LAB_0045dd14;
}
}
(**(code **)(*enginetrace + 0x14))
(enginetrace,&local_cc,uVar8,(CTraceFilterSkipTwoEntities *)&local_e0,local_70);
goto LAB_0045dd14;
}
}
pcVar2 = *(code **)(*(int *)this + 0x3c);
uVar8 = (**(code **)(*(int *)this + 0x40))(this,0,0);
iVar10 = *(int *)(this + 8);
local_cc = *(float *)(iVar10 + 0x9c);
local_c8 = *(float *)(iVar10 + 0xa0);
local_c4 = fVar15 + *(float *)(iVar10 + 0xa4);
(*pcVar2)(this,&local_cc,iVar10 + 0x9c,uVar8,8,local_70);
LAB_0045dd14:
if ((local_39 == '\0') && (local_3a == '\0')) {
iVar10 = *(int *)(this + 8);
*(undefined4 *)(iVar10 + 0x9c) = local_64;
*(undefined4 *)(iVar10 + 0xa0) = local_60;
*(undefined4 *)(iVar10 + 0xa4) = local_5c;
}
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.