CGameMovement::PlayerMove
0x0045de90 · 1986 bytes · __thiscall
_ZN13CGameMovement10PlayerMoveEv
Decompiled
undefined (1 param)
/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */
/* CGameMovement::PlayerMove() */
void __thiscall CGameMovement::PlayerMove(CGameMovement *this)
{
float fVar1;
CBaseEdict *this_00;
uint uVar2;
CBaseEntity CVar3;
char cVar4;
int iVar5;
CBaseEntity *pCVar6;
undefined *puVar7;
int *piVar8;
int iVar9;
longdouble lVar10;
float fVar11;
CEntityTemporaryMover *local_68;
float local_58;
undefined4 local_54;
undefined4 local_50;
undefined4 local_48;
undefined4 local_44;
int local_40;
float local_3c;
float local_38;
float local_34;
undefined4 local_30;
undefined4 local_2c;
undefined4 local_28;
undefined4 local_24;
undefined4 local_20;
local_30 = 0;
local_2c = 0;
local_28 = 0;
local_24 = 0;
local_20 = 0;
local_54 = 0;
local_50 = 0;
if (___atan2f_finite == 0) {
local_40 = 0;
}
else {
/* try { // try from 0045df37 to 0045df39 has its CatchHandler @ 0045e69d */
(**(code **)(___atan2f_finite + 0x50))
(___atan2f_finite,&local_54,0,0,0,0,
"/data/src/game/server/../../game/shared/gamemovement.cpp",0x147e,
&PlayerMove()::tm_fmt,"(%s)%s","Unaccounted","CGameMovement::PlayerMove");
local_40 = ___atan2f_finite;
}
iVar5 = _DAT_0105db00;
local_48 = local_54;
local_44 = local_50;
/* try { // try from 0045e0e6 to 0045e134 has its CatchHandler @ 0045e693 */
if (((_DAT_0105d154 != 0) || (DAT_0105d158 == '\0')) &&
(iVar9 = ThreadGetCurrentId(), iVar5 == iVar9)) {
if ((char *)*_DAT_0105d15c != "CGameMovement::PlayerMove") {
_DAT_0105d15c =
(int *)CVProfNode::GetSubNode((char *)_DAT_0105d15c,0xc1396a,(char *)0x1,0xbfafa1);
}
CVProfNode::EnterScope();
DAT_0105d158 = '\0';
}
/* try { // try from 0045df75 to 0045e082 has its CatchHandler @ 0045e667 */
(**(code **)(*(int *)this + 0xd0))(this);
iVar5 = *(int *)(this + 8);
*(undefined4 *)(iVar5 + 0x68) = 0;
*(undefined4 *)(iVar5 + 0x6c) = 0;
*(undefined4 *)(iVar5 + 0x70) = 0;
iVar5 = *(int *)(this + 8);
*(undefined4 *)(iVar5 + 0x74) = 0;
*(undefined4 *)(iVar5 + 0x78) = 0;
*(undefined4 *)(iVar5 + 0x7c) = 0;
(**(code **)(*IMoveHelper::sm_pSingleton + 8))(IMoveHelper::sm_pSingleton);
(**(code **)(*(int *)this + 0xd4))(this);
iVar5 = CFuncElevator::GetElevatorCount();
if (0 < iVar5) {
iVar9 = 0;
do {
pCVar6 = (CBaseEntity *)CFuncElevator::GetElevator(iVar9);
if (((byte)pCVar6[0x14d] & 8) != 0) {
CBaseEntity::CalcAbsolutePosition(pCVar6);
}
local_3c = *(float *)(pCVar6 + 0x2e0);
local_38 = *(float *)(pCVar6 + 0x2e4);
local_34 = *(float *)(pCVar6 + 0x2e8);
lVar10 = (longdouble)
CFuncElevator::GetHeightForTime
((CFuncElevator *)pCVar6,"CGameMovement::PlayerMove",
*(float *)(gpGlobals + 0xc),&local_58);
local_34 = (float)lVar10;
if (((byte)pCVar6[0x14d] & 8) != 0) {
/* try { // try from 0045e14b to 0045e268 has its CatchHandler @ 0045e667 */
CBaseEntity::CalcAbsolutePosition(pCVar6);
}
if (((*(float *)(pCVar6 + 0x2e0) != local_3c) || (*(float *)(pCVar6 + 0x2e4) != local_38)) ||
(*(float *)(pCVar6 + 0x2e8) != local_34)) {
CEntityTemporaryMover::Push((CEntityTemporaryMover *)&local_30,pCVar6);
CBaseEntity::SetAbsOrigin(pCVar6,(Vector *)&local_3c);
}
ElevatorPushPlayer(this,(CFuncElevator *)pCVar6);
iVar9 = iVar9 + 1;
} while (iVar9 != iVar5);
}
local_68 = (CEntityTemporaryMover *)&local_30;
AngleVectors((QAngle *)(*(int *)(this + 8) + 0xc),(Vector *)(this + 0x18),(Vector *)(this + 0x24),
(Vector *)(this + 0x30));
pCVar6 = *(CBaseEntity **)(this + 4);
CVar3 = pCVar6[0x186];
if (((((byte)CVar3 & 0xfd) == 8) || ((byte)CVar3 < 2)) || (pCVar6[0x1c80] != (CBaseEntity)0x0)) {
if (CVar3 == (CBaseEntity)0x2) goto LAB_0045e3bb;
LAB_0045e1a9:
(**(code **)(*(int *)this + 0xcc))(this,0);
LAB_0045e1bc:
pCVar6 = *(CBaseEntity **)(this + 4);
}
else {
cVar4 = (**(code **)(*(int *)this + 0xc0))(this);
if (cVar4 == '\0') {
LAB_0045e3a8:
pCVar6 = *(CBaseEntity **)(this + 4);
}
else {
cVar4 = CheckInterval(this,1);
if (cVar4 == '\0') {
*(undefined4 *)(*(int *)(this + 4) + 0x2338) = 0xffffffff;
goto LAB_0045e3a8;
}
iVar9 = CheckStuck(this);
iVar5 = _DAT_0105db00;
pCVar6 = *(CBaseEntity **)(this + 4);
if ((iVar9 != 0) &&
((((uVar2 = *(uint *)(pCVar6 + 0x2338), uVar2 == 0xffffffff ||
(puVar7 = g_pEntityList + (uVar2 & 0xfff) * 0x10, puVar7 == (undefined *)0xfffffffc)) ||
(*(uint *)(puVar7 + 8) != uVar2 >> 0xc)) || (*(int *)(puVar7 + 4) == 0)))) {
if (((DAT_0105d158 == '\0') || (_DAT_0105d154 != 0)) &&
(iVar9 = ThreadGetCurrentId(), iVar5 == iVar9)) {
cVar4 = CVProfNode::ExitScope();
if (cVar4 != '\0') {
_DAT_0105d15c = (int *)_DAT_0105d15c[0x19];
}
DAT_0105d158 = _DAT_0105d15c == (int *)0x105d160;
}
if (local_40 != 0) {
(**(code **)(local_40 + 0x54))(local_40,local_48,local_44,0,0,0);
}
goto LAB_0045e2b6;
}
}
if (pCVar6[0x186] != (CBaseEntity)0x2) goto LAB_0045e1a9;
LAB_0045e3bb:
if (((**(byte **)(this + 8) & 2) != 0) || (*(int *)(sv_optimizedmovement._28_4_ + 0x30) == 0))
goto LAB_0045e1a9;
if (250.0 < *(float *)(*(byte **)(this + 8) + 0x48)) {
(**(code **)(*(int *)this + 0x100))(this,0);
goto LAB_0045e1bc;
}
}
*(uint *)(this + 0xc) = (uint)(byte)pCVar6[0x253];
iVar5 = CBaseEntity::GetGroundEntity(pCVar6);
piVar8 = *(int **)(this + 4);
if (iVar5 == 0) {
fVar1 = (float)piVar8[0x6a9];
if ((fVar1 <= 0.0) || (*(char *)((int)piVar8 + 0x186) != '\x02')) {
iVar5 = *(int *)(this + 8);
fVar11 = *(float *)(iVar5 + 0x48);
if (fVar1 != -fVar11) {
(**(code **)(piVar8[0x690] + 4))(piVar8 + 0x690,piVar8 + 0x6a9);
piVar8[0x6a9] = (int)-fVar11;
piVar8 = *(int **)(this + 4);
goto LAB_0045e1dc;
}
}
else {
iVar5 = *(int *)(this + 8);
fVar11 = -*(float *)(iVar5 + 0x48);
if (-*(float *)(iVar5 + 0x48) <= fVar1) {
fVar11 = fVar1;
}
if (fVar1 != fVar11) {
(**(code **)(piVar8[0x690] + 4))(piVar8 + 0x690,piVar8 + 0x6a9);
piVar8[0x6a9] = (int)fVar11;
piVar8 = *(int **)(this + 4);
iVar5 = *(int *)(this + 8);
}
}
}
else {
LAB_0045e1dc:
iVar5 = *(int *)(this + 8);
}
*(undefined4 *)(this + 0x14) = 0;
(**(code **)(*piVar8 + 0x604))(piVar8,piVar8[0x85f],iVar5 + 0x9c,iVar5 + 0x40);
UpdateDuckJumpEyeOffset(this);
(**(code **)(*(int *)this + 0xe0))(this);
iVar5 = *(int *)(this + 4);
if ((*(char *)(iVar5 + 0x1c80) == '\0') && ((*(byte *)(iVar5 + 0x150) & 8) == 0)) {
/* try { // try from 0045e313 to 0045e588 has its CatchHandler @ 0045e667 */
cVar4 = (**(code **)(*(int *)this + 0xa8))(this);
if (cVar4 != '\0') {
LAB_0045e4ab:
iVar5 = *(int *)(this + 4);
goto LAB_0045e237;
}
CVar3 = (*(CBaseEntity **)(this + 4))[0x186];
if (CVar3 == (CBaseEntity)0x9) {
CBaseEntity::SetMoveType(*(CBaseEntity **)(this + 4),2,0);
iVar5 = *(int *)(this + 4);
if (*(char *)(iVar5 + 0x187) != '\0') {
if (*(char *)(iVar5 + 0x6c) == '\0') {
this_00 = *(CBaseEdict **)(iVar5 + 0x30);
if (this_00 != (CBaseEdict *)0x0) {
*(uint *)this_00 = *(uint *)this_00 | 0x101;
iVar9 = CBaseEdict::GetChangeAccessor(this_00);
*(undefined2 *)(iVar9 + 2) = 0;
}
}
else {
*(byte *)(iVar5 + 0x70) = *(byte *)(iVar5 + 0x70) | 1;
}
*(undefined1 *)(iVar5 + 0x187) = 0;
goto LAB_0045e4ab;
}
CVar3 = *(CBaseEntity *)(iVar5 + 0x186);
}
}
else {
LAB_0045e237:
CVar3 = *(CBaseEntity *)(iVar5 + 0x186);
}
switch(CVar3) {
case (CBaseEntity)0x0:
break;
case (CBaseEntity)0x1:
case (CBaseEntity)0x2:
(**(code **)(*(int *)this + 0x74))(this);
break;
default:
DevMsg(1,"Bogus pmove player movetype %i on (%i) 0=cl 1=sv\n",CVar3,1);
break;
case (CBaseEntity)0x4:
case (CBaseEntity)0x5:
(**(code **)(*(int *)this + 0x90))(this);
break;
case (CBaseEntity)0x8:
FullNoClipMove(this,*(float *)(sv_noclipspeed._28_4_ + 0x2c),
*(float *)(sv_noclipaccelerate._28_4_ + 0x2c));
break;
case (CBaseEntity)0x9:
(**(code **)(*(int *)this + 0x94))(this);
break;
case (CBaseEntity)0xa:
FullObserverMove(this);
break;
case (CBaseEntity)0xb:
(**(code **)(*(int *)this + 0x98))(this);
}
iVar5 = _DAT_0105db00;
if (((DAT_0105d158 == '\0') || (_DAT_0105d154 != 0)) &&
(iVar9 = ThreadGetCurrentId(), iVar5 == iVar9)) {
cVar4 = CVProfNode::ExitScope();
if (cVar4 != '\0') {
_DAT_0105d15c = (int *)_DAT_0105d15c[0x19];
}
DAT_0105d158 = _DAT_0105d15c == (int *)0x105d160;
}
if (local_40 != 0) {
(**(code **)(local_40 + 0x54))(local_40,local_48,local_44,0,0,0);
}
LAB_0045e2b6:
CEntityTemporaryMover::~CEntityTemporaryMover(local_68);
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.