CCSGameMovement::CheckJumpButton
0x0042f7b0 · 1126 bytes · __thiscall
_ZN15CCSGameMovement15CheckJumpButtonEv
Decompiled
undefined (1 param)
/* CCSGameMovement::CheckJumpButton() */
undefined4 __thiscall CCSGameMovement::CheckJumpButton(CCSGameMovement *this)
{
float fVar1;
CBaseEdict *pCVar2;
code *pcVar3;
char cVar4;
int iVar5;
int iVar6;
int *piVar7;
undefined4 uVar8;
longdouble lVar9;
float fVar10;
if ((*(int *)(this + 0x7e0) == 0) || (*(char *)(*(int *)(this + 0x7e0) + 0x1c80) == '\0')) {
lVar9 = (longdouble)CBasePlayer::GetWaterJumpTime(*(CBasePlayer **)(this + 4));
if ((float)lVar9 != 0.0) {
lVar9 = (longdouble)CBasePlayer::GetWaterJumpTime(*(CBasePlayer **)(this + 4));
CBasePlayer::SetWaterJumpTime
(*(CBasePlayer **)(this + 4),(float)lVar9 - *(float *)(gpGlobals + 0x10));
lVar9 = (longdouble)CBasePlayer::GetWaterJumpTime(*(CBasePlayer **)(this + 4));
if (0.0 <= (float)lVar9) {
return 0;
}
CBasePlayer::SetWaterJumpTime(*(CBasePlayer **)(this + 4),0.0);
return 0;
}
if (1 < (byte)(*(CBaseEntity **)(this + 4))[0x253]) {
(**(code **)(*(int *)this + 0x100))(this,0);
iVar5 = CBaseEntity::GetWaterType(*(CBaseEntity **)(this + 4));
if (iVar5 == 0x20) {
*(undefined4 *)(*(int *)(this + 8) + 0x48) = 0x42c80000;
}
else {
iVar5 = CBaseEntity::GetWaterType(*(CBaseEntity **)(this + 4));
if (iVar5 == 0x10) {
*(undefined4 *)(*(int *)(this + 8) + 0x48) = 0x42a00000;
}
}
lVar9 = (longdouble)CBasePlayer::GetSwimSoundTime(*(CBasePlayer **)(this + 4));
if (0.0 < (float)lVar9) {
return 0;
}
CBasePlayer::SetSwimSoundTime(*(CBasePlayer **)(this + 4),1000.0);
(**(code **)(*(int *)this + 0xfc))(this);
return 0;
}
iVar6 = CBaseEntity::GetGroundEntity(*(CBaseEntity **)(this + 4));
iVar5 = *(int *)(this + 8);
if (iVar6 != 0) {
if ((*(byte *)(iVar5 + 0x28) & 2) != 0) {
return 0;
}
(**(code **)(*(int *)this + 0x100))(this,0);
piVar7 = *(int **)(this + 4);
(**(code **)(*piVar7 + 0x608))(piVar7,*(int *)(this + 8) + 0x9c,piVar7[0x85f],0x3f800000,1);
(**(code **)(**(int **)(this + 0x7e0) + 0x7fc))(*(int **)(this + 0x7e0),7,0);
piVar7 = *(int **)(this + 4);
if (piVar7[0x85f] == 0) {
fVar10 = 301.99338;
}
else {
fVar10 = *(float *)(piVar7[0x85f] + 0x48) * 301.99338;
}
cVar4 = (**(code **)(*piVar7 + 0x778))(piVar7);
iVar5 = *(int *)(this + 8);
if ((cVar4 != '\0') && ((*(byte *)(iVar5 + 0x24) & 4) == 0)) {
iVar5 = *(int *)(this + 0x7e0);
if (*(char *)(iVar5 + 0x2898) != '\x01') {
if (*(char *)(iVar5 + 0x6c) == '\0') {
pCVar2 = *(CBaseEdict **)(iVar5 + 0x30);
if (pCVar2 != (CBaseEdict *)0x0) {
*(uint *)pCVar2 = *(uint *)pCVar2 | 0x101;
iVar6 = CBaseEdict::GetChangeAccessor(pCVar2);
*(undefined2 *)(iVar6 + 2) = 0;
}
}
else {
*(byte *)(iVar5 + 0x70) = *(byte *)(iVar5 + 0x70) | 1;
}
*(undefined1 *)(iVar5 + 0x2898) = 1;
}
(**(code **)(*(int *)this + 0xec))(this);
iVar5 = *(int *)(this + 8);
}
fVar1 = *(float *)(iVar5 + 0x48);
if (((*(char *)(*(int *)(this + 0x7e0) + 0x2898) == '\0') &&
(*(char *)(*(int *)(this + 4) + 0x1a91) == '\0')) &&
((*(byte *)(*(int *)(this + 4) + 0x150) & 2) == 0)) {
*(float *)(iVar5 + 0x48) = fVar1 + fVar10;
}
else {
*(float *)(iVar5 + 0x48) = fVar10;
}
iVar5 = *(int *)(this + 0x7e0);
if (iVar5 != 0) {
fVar10 = *(float *)(&DAT_00002848 + iVar5);
if (0.0 < fVar10) {
*(float *)(*(int *)(this + 8) + 0x48) =
(100.0 - fVar10 * 0.019) * 0.01 * *(float *)(*(int *)(this + 8) + 0x48);
iVar5 = *(int *)(this + 0x7e0);
fVar10 = *(float *)(&DAT_00002848 + iVar5);
}
if (fVar10 != 1315.7894) {
if (*(char *)(iVar5 + 0x6c) == '\0') {
pCVar2 = *(CBaseEdict **)(iVar5 + 0x30);
if (pCVar2 != (CBaseEdict *)0x0) {
*(uint *)pCVar2 = *(uint *)pCVar2 | 0x101;
iVar6 = CBaseEdict::GetChangeAccessor(pCVar2);
*(undefined2 *)(iVar6 + 2) = 0;
}
}
else {
*(byte *)(iVar5 + 0x70) = *(byte *)(iVar5 + 0x70) | 1;
}
*(undefined4 *)(&DAT_00002848 + iVar5) = 0x44a47943;
}
}
CGameMovement::FinishGravity((CGameMovement *)this);
iVar5 = *(int *)(this + 8);
*(float *)(iVar5 + 0x70) = (*(float *)(iVar5 + 0x48) + *(float *)(iVar5 + 0x70)) - fVar1;
*(float *)(*(int *)(this + 8) + 100) = *(float *)(*(int *)(this + 8) + 100) + 0.1;
piVar7 = (int *)(**(code **)(*gameeventmanager + 0x1c))(gameeventmanager,"player_jump",0,0);
if (piVar7 != (int *)0x0) {
pcVar3 = *(code **)(*piVar7 + 0x30);
uVar8 = (**(code **)(*engine + 0x40))(engine,*(undefined4 *)(*(int *)(this + 4) + 0x30));
(*pcVar3)(piVar7,"userid",uVar8);
(**(code **)(*gameeventmanager + 0x20))(gameeventmanager,piVar7,0);
}
*(uint *)(*(int *)(this + 8) + 0x28) = *(uint *)(*(int *)(this + 8) + 0x28) | 2;
return 1;
}
}
else {
iVar5 = *(int *)(this + 8);
}
*(uint *)(iVar5 + 0x28) = *(uint *)(iVar5 + 0x28) | 2;
return 0;
}
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.