CPlayerMove::RunCommand
0x007c8b10 · 3175 bytes · __thiscall
_ZN11CPlayerMove10RunCommandEP11CBasePlayerP8CUserCmdP11IMoveHelper
Decompiled
undefined (4 params)
/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */
/* CPlayerMove::RunCommand(CBasePlayer*, CUserCmd*, IMoveHelper*) */
void __thiscall
CPlayerMove::RunCommand
(CPlayerMove *this,CBasePlayer *param_1,CUserCmd *param_2,IMoveHelper *param_3)
{
float fVar1;
CUserCmd CVar2;
uint uVar3;
uint uVar4;
byte *pbVar5;
CBaseEdict *this_00;
char cVar6;
byte *pbVar7;
int iVar8;
int *piVar9;
int iVar10;
int iVar11;
float fVar12;
char *pcVar13;
undefined *puVar14;
undefined4 local_34;
undefined4 local_30;
undefined4 local_28;
undefined4 local_24;
int local_20;
(**(code **)(*(int *)this + 0x14))(this,param_1,param_2);
iVar8 = gpGlobals;
fVar12 = *(float *)(gpGlobals + 0x1c);
*(float *)(gpGlobals + 0xc) = (float)*(int *)(param_1 + 0x2054) * fVar12;
if (param_1[0x205c] != (CBasePlayer)0x0) {
fVar12 = 0.0;
}
*(float *)(iVar8 + 0x10) = fVar12;
uVar3 = *(uint *)(param_1 + 0x1cc4);
uVar4 = *(uint *)(param_2 + 0x24);
*(uint *)(param_2 + 0x24) = uVar3 | uVar4;
*(uint *)(param_2 + 0x24) = ~*(uint *)(param_1 + 0x1cc0) & (uVar3 | uVar4);
if ((((param_1[0x205c] != (CBasePlayer)0x0) && (param_1[0x186] == (CBasePlayer)0x8)) &&
(*(int *)(*(int *)(sv_cheats + 0x1c) + 0x30) != 0)) &&
(*(int *)(sv_noclipduringpause._28_4_ + 0x30) != 0)) {
*(undefined4 *)(iVar8 + 0x10) = *(undefined4 *)(iVar8 + 0x1c);
}
(**(code **)(*(int *)g_pGameMovement + 0x10))(g_pGameMovement,param_1);
CommentarySystem_PePlayerRunCommand(param_1,param_2);
uVar3 = *(uint *)(param_2 + 0x2c);
if (uVar3 != 0) {
if (uVar3 < 0x800) {
pbVar5 = *(byte **)(gpGlobals + 0x58);
if (pbVar5 != (byte *)0x0) {
pbVar7 = pbVar5 + uVar3 * 0x10;
if ((*pbVar7 & 2) != 0) goto LAB_007c95c0;
LAB_007c8be0:
piVar9 = *(int **)(pbVar7 + 0xc);
if (((piVar9 != (int *)0x0) && (iVar8 = (**(code **)(*piVar9 + 0x18))(piVar9), iVar8 != 0))
&& (iVar8 = __dynamic_cast(iVar8,&CBaseEntity::typeinfo,&CBaseCombatWeapon::typeinfo,0),
iVar8 != 0)) {
local_34 = 0;
local_30 = 0;
if (___atan2f_finite == 0) {
local_20 = 0;
}
else {
(**(code **)(___atan2f_finite + 0x50))
(___atan2f_finite,&local_34,0,0,0,0,"/data/src/game/server/player_command.cpp"
,0x16a,&RunCommand(CBasePlayer*,CUserCmd*,IMoveHelper*)::tm_fmt,"(%s)%s",
"Unaccounted","player->SelectItem()");
local_20 = ___atan2f_finite;
}
iVar11 = _DAT_0105db00;
local_28 = local_34;
local_24 = local_30;
/* try { // try from 007c94e0 to 007c952f has its CatchHandler @ 007c9824 */
if (((_DAT_0105d154 != 0) || (DAT_0105d158 == '\0')) &&
(iVar10 = ThreadGetCurrentId(), iVar11 == iVar10)) {
if ((char *)*_DAT_0105d15c != "player->SelectItem()") {
_DAT_0105d15c =
(int *)CVProfNode::GetSubNode
((char *)_DAT_0105d15c,0xcbc52a,(char *)0x1,0xbfafa1);
}
CVProfNode::EnterScope();
DAT_0105d158 = '\0';
}
/* try { // try from 007c8cd9 to 007c8cde has its CatchHandler @ 007c9836 */
(**(code **)(*(int *)param_1 + 0x6b8))(param_1,iVar8);
iVar8 = _DAT_0105db00;
if (((DAT_0105d158 == '\0') || (_DAT_0105d154 != 0)) &&
(iVar11 = ThreadGetCurrentId(), iVar8 == iVar11)) {
cVar6 = CVProfNode::ExitScope();
if (cVar6 != '\0') {
_DAT_0105d15c = (int *)_DAT_0105d15c[0x19];
}
DAT_0105d158 = _DAT_0105d15c == (int *)0x105d160;
}
if (local_20 != 0) {
(**(code **)(local_20 + 0x54))(local_20,local_28,local_24,0,0,0);
}
}
}
}
else {
pbVar5 = *(byte **)(gpGlobals + 0x58);
if (*(byte **)(gpGlobals + 0x58) != (byte *)0x0) {
LAB_007c95c0:
pbVar7 = pbVar5;
if ((*pbVar7 & 2) == 0) goto LAB_007c8be0;
}
}
}
piVar9 = (int *)(**(code **)(*(int *)param_1 + 0x500))(param_1);
CVar2 = param_2[0x28];
if (CVar2 != (CUserCmd)0x0) {
if (piVar9 != (int *)0x0) {
cVar6 = CBasePlayer::UsingStandardWeaponsInVehicle(param_1);
if (cVar6 == '\0') goto LAB_007c8d60;
CVar2 = param_2[0x28];
}
*(uint *)(param_1 + 0x2020) = (uint)(byte)CVar2;
}
LAB_007c8d60:
local_34 = 0;
local_30 = 0;
if (___atan2f_finite == 0) {
local_20 = 0;
}
else {
(**(code **)(___atan2f_finite + 0x50))
(___atan2f_finite,&local_34,0,0,0,0,"/data/src/game/server/player_command.cpp",0x17d,
&RunCommand(CBasePlayer*,CUserCmd*,IMoveHelper*)::tm_fmt,"(%s)%s","Unaccounted",
"player->UpdateButtonState");
local_20 = ___atan2f_finite;
}
iVar8 = _DAT_0105db00;
local_28 = local_34;
local_24 = local_30;
/* try { // try from 007c9268 to 007c92b7 has its CatchHandler @ 007c9856 */
if (((_DAT_0105d154 != 0) || (DAT_0105d158 == '\0')) &&
(iVar11 = ThreadGetCurrentId(), iVar8 == iVar11)) {
if ((char *)*_DAT_0105d15c != "player->UpdateButtonState") {
_DAT_0105d15c =
(int *)CVProfNode::GetSubNode((char *)_DAT_0105d15c,0xcbc53f,(char *)0x1,0xbfafa1);
}
CVProfNode::EnterScope();
DAT_0105d158 = '\0';
}
/* try { // try from 007c8e12 to 007c8e16 has its CatchHandler @ 007c9846 */
CBasePlayer::UpdateButtonState(param_1,*(int *)(param_2 + 0x24));
iVar8 = _DAT_0105db00;
if (((DAT_0105d158 == '\0') || (_DAT_0105d154 != 0)) &&
(iVar11 = ThreadGetCurrentId(), iVar8 == iVar11)) {
cVar6 = CVProfNode::ExitScope();
if (cVar6 != '\0') {
_DAT_0105d15c = (int *)_DAT_0105d15c[0x19];
}
DAT_0105d158 = _DAT_0105d15c == (int *)0x105d160;
}
if (local_20 != 0) {
(**(code **)(local_20 + 0x54))(local_20,local_28,local_24,0,0,0);
}
CheckMovingGround(this,param_1,(double)*(float *)(gpGlobals + 0x1c));
puVar14 = g_pMoveData;
*(undefined4 *)(g_pMoveData + 0x58) = *(undefined4 *)(param_1 + 0x1c84);
*(undefined4 *)(puVar14 + 0x5c) = *(undefined4 *)(param_1 + 0x1c88);
*(undefined4 *)(puVar14 + 0x60) = *(undefined4 *)(param_1 + 0x1c8c);
if (*(int *)(param_1 + 0x1c94) == 0) {
*(undefined4 *)(param_1 + 0x1c84) = *(undefined4 *)(param_2 + 0xc);
*(undefined4 *)(param_1 + 0x1c88) = *(undefined4 *)(param_2 + 0x10);
*(undefined4 *)(param_1 + 0x1c8c) = *(undefined4 *)(param_2 + 0x14);
}
else if (*(int *)(param_1 + 0x1c94) == 2) {
fVar12 = *(float *)(param_2 + 0x14);
fVar1 = *(float *)(param_2 + 0xc);
*(float *)(param_1 + 0x1c88) = *(float *)(param_1 + 0x1c9c) + *(float *)(param_2 + 0x10);
*(float *)(param_1 + 0x1c8c) = *(float *)(param_1 + 0x1ca0) + fVar12;
*(float *)(param_1 + 0x1c84) = *(float *)(param_1 + 0x1c98) + fVar1;
}
*(undefined4 *)(param_1 + 0x13c) = *(undefined4 *)(param_2 + 0x40);
*(undefined4 *)(param_1 + 0x140) = *(undefined4 *)(param_2 + 0x44);
*(undefined4 *)(param_1 + 0x144) = *(undefined4 *)(param_2 + 0x48);
*(undefined4 *)(param_1 + 0x130) = *(undefined4 *)(param_2 + 0x4c);
*(undefined4 *)(param_1 + 0x134) = *(undefined4 *)(param_2 + 0x50);
*(undefined4 *)(param_1 + 0x138) = *(undefined4 *)(param_2 + 0x54);
RunPreThink(this,param_1);
RunThink((CBasePlayer *)this,
(double)CONCAT44(SUB84((double)*(float *)(gpGlobals + 0x1c),0),param_1));
pcVar13 = (char *)param_3;
puVar14 = g_pMoveData;
(**(code **)(*(int *)this + 0xc))(this,param_1,param_2,param_3,g_pMoveData);
local_34 = 0;
local_30 = 0;
if (piVar9 == (int *)0x0) {
if (___atan2f_finite == 0) {
local_20 = 0;
}
else {
pcVar13 = (char *)0x0;
puVar14 = (undefined *)0x0;
(**(code **)(___atan2f_finite + 0x50))
(___atan2f_finite,&local_34,0,0,0,0,"/data/src/game/server/player_command.cpp",0x1a0
,&RunCommand(CBasePlayer*,CUserCmd*,IMoveHelper*)::tm_fmt,"(%s)%s","Unaccounted",
"g_pGameMovement->ProcessMovement()");
local_20 = ___atan2f_finite;
}
iVar8 = _DAT_0105db00;
local_28 = local_34;
local_24 = local_30;
/* try { // try from 007c96b4 to 007c96b8 has its CatchHandler @ 007c9810 */
if (((_DAT_0105d154 != 0) || (DAT_0105d158 == '\0')) &&
(iVar11 = ThreadGetCurrentId(), iVar8 == iVar11)) {
if ((char *)*_DAT_0105d15c != "g_pGameMovement->ProcessMovement()") {
puVar14 = (undefined *)0x0;
pcVar13 = "Unaccounted";
/* try { // try from 007c9798 to 007c97a9 has its CatchHandler @ 007c9810 */
_DAT_0105d15c =
(int *)CVProfNode::GetSubNode((char *)_DAT_0105d15c,0xcbc604,(char *)0x1,0xbfafa1);
}
CVProfNode::EnterScope();
DAT_0105d158 = '\0';
}
/* try { // try from 007c96da to 007c96dc has its CatchHandler @ 007c9814 */
(**(code **)(*(int *)g_pGameMovement + 8))(g_pGameMovement,param_1,g_pMoveData,pcVar13,puVar14);
iVar8 = _DAT_0105db00;
if (((DAT_0105d158 == '\0') || (_DAT_0105d154 != 0)) &&
(iVar11 = ThreadGetCurrentId(), iVar8 == iVar11)) {
cVar6 = CVProfNode::ExitScope();
if (cVar6 != '\0') {
_DAT_0105d15c = (int *)_DAT_0105d15c[0x19];
}
DAT_0105d158 = _DAT_0105d15c == (int *)0x105d160;
}
if (local_20 != 0) {
(**(code **)(local_20 + 0x54))(local_20,local_28,local_24,0,0,0);
}
}
else {
if (___atan2f_finite == 0) {
local_20 = 0;
}
else {
pcVar13 = (char *)0x0;
puVar14 = (undefined *)0x0;
(**(code **)(___atan2f_finite + 0x50))
(___atan2f_finite,&local_34,0,0,0,0,"/data/src/game/server/player_command.cpp",0x1a6
,&RunCommand(CBasePlayer*,CUserCmd*,IMoveHelper*)::tm_fmt,"(%s)%s","Unaccounted",
"pVehicle->ProcessMovement()");
local_20 = ___atan2f_finite;
}
iVar8 = _DAT_0105db00;
local_28 = local_34;
local_24 = local_30;
/* try { // try from 007c93c8 to 007c9417 has its CatchHandler @ 007c9858 */
if (((_DAT_0105d154 != 0) || (DAT_0105d158 == '\0')) &&
(iVar11 = ThreadGetCurrentId(), iVar8 == iVar11)) {
if ((char *)*_DAT_0105d15c != "pVehicle->ProcessMovement()") {
puVar14 = (undefined *)0x0;
pcVar13 = "Unaccounted";
_DAT_0105d15c =
(int *)CVProfNode::GetSubNode((char *)_DAT_0105d15c,0xcbc559,(char *)0x1,0xbfafa1);
}
CVProfNode::EnterScope();
DAT_0105d158 = '\0';
}
/* try { // try from 007c9046 to 007c9048 has its CatchHandler @ 007c9826 */
(**(code **)(*piVar9 + 0x14))(piVar9,param_1,g_pMoveData,pcVar13,puVar14);
iVar8 = _DAT_0105db00;
if (((DAT_0105d158 == '\0') || (_DAT_0105d154 != 0)) &&
(iVar11 = ThreadGetCurrentId(), iVar8 == iVar11)) {
cVar6 = CVProfNode::ExitScope();
if (cVar6 != '\0') {
_DAT_0105d15c = (int *)_DAT_0105d15c[0x19];
}
DAT_0105d158 = _DAT_0105d15c == (int *)0x105d160;
}
if (local_20 != 0) {
(**(code **)(local_20 + 0x54))(local_20,local_28,local_24,0,0,0);
}
}
(**(code **)(*(int *)this + 0x10))(this,param_1,param_2,g_pMoveData);
local_34 = 0;
local_30 = 0;
if (___atan2f_finite == 0) {
local_20 = 0;
}
else {
(**(code **)(___atan2f_finite + 0x50))
(___atan2f_finite,&local_34,0,0,0,0,"/data/src/game/server/player_command.cpp",0x1ae,
&RunCommand(CBasePlayer*,CUserCmd*,IMoveHelper*)::tm_fmt,"(%s)%s","Unaccounted",
"moveHelper->ProcessImpacts");
local_20 = ___atan2f_finite;
}
iVar8 = _DAT_0105db00;
local_28 = local_34;
local_24 = local_30;
/* try { // try from 007c9316 to 007c9364 has its CatchHandler @ 007c9862 */
if (((_DAT_0105d154 != 0) || (DAT_0105d158 == '\0')) &&
(iVar11 = ThreadGetCurrentId(), iVar8 == iVar11)) {
if ((char *)*_DAT_0105d15c != "moveHelper->ProcessImpacts") {
_DAT_0105d15c =
(int *)CVProfNode::GetSubNode((char *)_DAT_0105d15c,0xcbc575,(char *)0x1,0xbfafa1);
}
CVProfNode::EnterScope();
DAT_0105d158 = '\0';
}
/* try { // try from 007c9163 to 007c9165 has its CatchHandler @ 007c97ef */
(**(code **)(*(int *)param_3 + 0x14))(param_3);
iVar8 = _DAT_0105db00;
if (((DAT_0105d158 == '\0') || (_DAT_0105d154 != 0)) &&
(iVar11 = ThreadGetCurrentId(), iVar8 == iVar11)) {
cVar6 = CVProfNode::ExitScope();
if (cVar6 != '\0') {
_DAT_0105d15c = (int *)_DAT_0105d15c[0x19];
}
DAT_0105d158 = _DAT_0105d15c == (int *)0x105d160;
}
if (local_20 != 0) {
(**(code **)(local_20 + 0x54))(local_20,local_28,local_24,0,0,0);
}
RunPostThink(this,param_1);
(**(code **)(*(int *)g_pGameMovement + 0x14))(g_pGameMovement,param_1);
(**(code **)(*(int *)g_pGameMovement + 0xc))(g_pGameMovement);
FinishCommand(this,param_1);
iVar8 = gpGlobals;
*(int *)(param_1 + 0x2058) = *(int *)(param_1 + 0x2054);
if (*(float *)(iVar8 + 0x10) != 0.0) {
iVar8 = *(int *)(param_1 + 0x2054) + 1;
if (param_1[0x6c] == (CBasePlayer)0x0) {
this_00 = *(CBaseEdict **)(param_1 + 0x30);
if (this_00 != (CBaseEdict *)0x0) {
*(uint *)this_00 = *(uint *)this_00 | 0x101;
iVar11 = CBaseEdict::GetChangeAccessor(this_00);
*(undefined2 *)(iVar11 + 2) = 0;
}
*(int *)(param_1 + 0x2054) = iVar8;
}
else {
param_1[0x70] = (CBasePlayer)((byte)param_1[0x70] | 1);
*(int *)(param_1 + 0x2054) = iVar8;
}
return;
}
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.